简体   繁体   English

我在vb.net的webform1中有1个文本框和复选框,在seconf webform中有1个文本框!

[英]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 在按钮单击事件上,当我单击LinkBut​​ton1时,我重定向到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"

If you use Response.Redirect() it will load new page .Use Cookies to store TextBox Values 如果使用Response.Redirect()它将加载新页面。使用Cookies来存储TextBox值

check this 检查这个

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.

相关问题 VB.net Webform Gridview与复选框DataControlRowType - VB.net Webform Gridview with checkbox DataControlRowType 我在asp.net webform中已经有3个复选框和1个文本框,当我选中1和2复选框时,结果文本框将为1,2 - I already have 3 checkboxes and 1 textbox in asp.net webform when i check 1and 2 checkbox then result in textbox will be 1,2 onkeypress无法与asp.net Webform中的文本框一起使用 - onkeypress is not working with textbox in asp.net webform 我的VB.NET Webform上没有KeyDown事件 - No KeyDown event on my VB.NET Webform 当我在textbox1和textbox2中输入目标时,如何在buttonclick上的asp.net网络窗体中显示gmap - how to show the gmap in asp.net webform on buttonclick when i enter destinations in textbox1 and textbox2 在webform1中捕获webform 2的按钮单击事件 - Capture button click event of webform 2 in webform1 在ASP.NET Web表单中的复选框列表选项旁边动态添加文本框 - Dynamically add textbox next to checkbox list option in asp.net webform 使用asp.net webform中的文本框处理radiobutoon的错误处理 - Error handling for radiobutoon with textbox in asp.net webform Asp.net WebForm中UpdatePanel内的模板TextBox字段 - Template TextBox feild inside UpdatePanel in Asp.net WebForm 在VB.net中的一个Web表单之间将购物车值传递到另一个Web表单中 - Passing cart value between one webform to another in VB.net asp.net
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM