开发者

I have 1 textbox and checkbox in webform1 and one textbox in seconf webform in vb.net !

开发者 https://www.devze.com 2023-01-30 01:36 出处:网络
开发者_StackOverflow中文版I have textbox1 in Default.aspx vb.net page with textbox1.text=\"Sumit\"
开发者_StackOverflow中文版

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

0

精彩评论

暂无评论...
验证码 换一张
取 消