Solved

text box in the master page retaining text across content pages

Posted on 2010-11-11
3
545 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Word Template Mail merge with vb.net 4 40
Data Saving 5 28
Jquery autocomplete 10 23
Visual Studio 2013 debugging 2 16
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now