Pass values from one user control to a user control on a different aspx page


I have an aspx page titled Search.aspx. Within this page, I have a user control titled Search.ascx. I want a user to input search terms, then on the click of a button, I want to pass the values to another page (SearchResults.aspx)....which will then display the results in a user control.
Can someone please give me some suggestions on how to do this?
Thanks a lot!

4/21/2004 10:10:33 AM 91979 articles. 4 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 22
Get it on Google Play
Get it on Apple App Store

Hello, what you can do is:

inside ur usercontrol, create a method that returns a dataset or datareader. that is, since u are searching using the usercontrol, then the result of ur search will be returned by a method of type either dataset or datareader.
and in ur code-behind of the aspx page u can use it as follows:
protected Myusercontrol user;
private DataSet ds = user.GetResults();
and then u might want to put it in a session variable or xml file and then u will be able to access it from the SearchResults.aspx
but why do u want to show results in another page ?
Bilal Hadiar, MCP, MCTS, MCPD, MCT
Microsoft MVP - Telerik MVP
4/21/2004 11:23:04 AM

Web resources about - Pass values from one user control to a user control on a different aspx page -

Bill Clinton Visited Ohio State Practice, Took a Picture with Ezekiel Elliott
President Bill Clinton came by practice today! #Zeke4Heisman ! #GoBucks ! #TheGrindNEVERStops @EzekielElliott — Ambassador ...

Democrats Call Trump’s Muslim Database Comments ‘Shocking’
Donald Trump’s assertion that he would make Muslims in America register in a database has forced candidates of both parties to stake out clearer ...

Adele Writes Fans Open Letter on '25' Album Release Day
Adele has written an open letter to her fans to celebrate the release of her new album 25 , which is in stores now! The 27-year-old British ...

Anirban Lahiri Bounces Back With a Solid Second Round at World Tour Championships Anirban Lahiri Bounces Back With a Solid Second Round at World Tour Championships Lahiri is eight shots behind ...

Jared Fogle Gets 15 Years For Having Sex With Minors, Must Serve 85 Percent Of Sentence
Jared Fogle gets 15 years and 8 months, a total of 188 months, after a conviction on child pornography and sex with minors charges. U.S. District ...

Melissa McCarthy Brawls Over Brownie Sales in First ‘The Boss’ Trailer
Who’s “The Boss”? Oh, that’s just Melissa McCarthy in a comically bad wig. The “Mike & Molly” actress debuted her trailer for upcoming April ...

170 hostages reportedly taken in Mali hotel attack
Gunmen stormed the luxury Radisson Blu Hotel in Mali's capital earlier today, reportedly taking up to 170 hostages. The BBC reports that Malian ...

IBM launches Identity Mixer, a cryptographic tool for developers to help curb online identity theft
Way back in January, IBM unveiled a new cryptographic tool called Identity Mixer , designed to protect your digital data from hackers. Today, ...

LG Stops Selling New Smartwatch After Six Days Because Of Hardware Issue
If you were planning to run out and buy LG’s new smartwatch, it’s time to come up with a contingency plan: the company has canceled sales of ...

How to do Black Friday like a pro
The golden rule of Black Friday is to keep your head when all about you are losing theirs. Here's how to do that while bagging the best bargains ...

resources last updated: 11/20/2015 4:09:18 PM