Solved

text box in the master page retaining text across content pages

Posted on 2010-11-11
3
551 Views
Last Modified: 2012-08-13
I have a text box in master page. When the user enters text and hits on the search button, the user is redirected to another content page. However the value in the textbox that was entered by the user is not retained in the new content page. Please suggest how I can retain the value. thanks
0
Comment
Question by:TrialUser
3 Comments
 
LVL 18

Accepted Solution

by:
Richard Lee earned 250 total points
ID: 34111355
If you use a redirect to another page then the ViewState is lost. ViewState is per page and used to maintain the value of the textbox across postbacks. Saying all of that I get to the solution finally - you will need to pass the value across to the other page. The best way is by QueryString. Why I hear you ask, well you could just as done with google distribute a search just using the URL.

DaTribe
0
 
LVL 10

Assisted Solution

by:P1ST0LPETE
P1ST0LPETE earned 250 total points
ID: 34111870
There is a multitude of ways you go about doing this.

1. Store value in Session Variable: http://www.codeproject.com/KB/aspnet/ExploringSession.aspx

2. Store value in Cookie: http://www.geekpedia.com/tutorial81_Handling-cookies-in-ASP-.NET.html

3. Access Previous Page Values: http://www.aspdotnetfaq.com/Faq/How-to-make-Cross-Page-Postback-in-ASP-Net.aspx

4. Storing value in Query String: http://www.aspnet101.com/2007/07/querystring-results-and-sql-statements/

5. Store value in database on source page, then access the value on target page.
0
 

Author Closing Comment

by:TrialUser
ID: 34114425
thx
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question