[英]I have 1 textbox and checkbox in webform1 and one textbox in seconf webform in vb.net !
I have textbox1
in Default.aspx vb.net page with textbox1.text="Sumit"
我在Default.aspx vb.net页面中有
textbox1
,其中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 在按钮单击事件上,当我单击LinkButton1时,我重定向到Default2.aspx,并在Default2.aspx中重定向,然后重定向回Default.aspx
But then i see the textbox1.text will remove but i want the textbox1.text="Sumit"
after i redirect to textbox1 again .. 但是然后我看到textbox1.text将被删除,但是我想再次重定向到textbox1后使用
textbox1.text="Sumit"
。
Store the value of the textbox in Session in the button click event: 将文本框的值存储在Session中的按钮单击事件中:
Session("textbox1_text") = textbox1.text
Then in Page_Load event have such code: 然后在Page_Load事件中有这样的代码:
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. 请注意,这会将文本设置为用户始终写的最后一个文本,而不仅仅是从page2重定向时,这样您就可以在重定向时在URL上添加标志,并在从会话分配文本框值之前检查该标志。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.