?
Solved

text box in the master page retaining text across content pages

Posted on 2010-11-11
3
Medium Priority
?
560 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 18

Accepted Solution

by:
Richard Lee earned 1000 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 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

649 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