hello ,
if i want to retain my value of a textbox on refresh of a page or on previous page. how can i do it.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
selva kumarRank #2,987 · 483 reputationPosted Jun 12, 2013, 3:42 AM EDT
http://www.codeproject.com/KB/custom-controls/ASPNET_Password_TextBox.aspx
use above link it will be helful......
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jun 11, 2013, 10:53 PM EDT
ashima kukreja19 reputationPosted Jun 12, 2013, 2:45 AM EDT
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jun 12, 2013, 2:58 AM EDT
ex-
consider a button click event
protected void Button1_Click(object sender, EventArgs e)
{
TextBox1.Text=Session["name"].ToString();
}
and if you call the clear text box method in page load put it within
if (!Page.IsPostBack)
{
TextBox1.Text=string.Empty;
}
so on every poatback it will not get cleared.
if not solved, provide your source code
Jignesh TrivediRank #16 · 50.3K reputationPosted Jun 12, 2013, 3:08 AM EDT
hi,
It is depending on Situation.
you have also Page.PreviousPage property. with the help of this you can find value of previous page.
for example.....
TextBox tb = (TextBox)PreviousPage.FindControl("Text1");
Please refer
http://msdn.microsoft.com/en-us/library/system.web.ui.page.previouspage.aspx
http://msdn.microsoft.com/en-us/library/6c3yckfw(v=vs.85).aspx
hope this will help you.