I have textbox1
in Default.aspx vb.net page with textbox1.text="Sumit"
On button click event I redirect to Default2.aspx and in Default2.aspx when i click on LinkButton1 then i redirect back to Default.aspx
But then i see the textbox1.text will remove but i want the textbox1.text="Sumit"
after i redirect to textbox1 again ..
Store the value of the textbox in Session in the button click event:
Session("textbox1_text") = textbox1.text
Then in Page_Load event have such code:
textbox1.text = Session("textbox1_text")
Note, this will set the text to the last text the user wrote always, not just when redircting from page2 so you can add flag on the URL when redirecting and check that flag before assigning the textbox value from session.
If you use Response.Redirect()
it will load new page .Use Cookies to store TextBox Values
check this
精彩评论