如何将文本框值从一个页面转换到另一个页面? [英] How to get the text box value form one page to another page?

查看:127
本文介绍了如何将文本框值从一个页面转换到另一个页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!



在我的第一页中,我有2个文本框和一个按钮。第一个用于用户名,另一个用于id。我想要做的是,文本框值将从第一页获取,并在用户单击按钮后显示在下一页的文本框内。怎么做?

解决方案

有三种方法:

1)查询字符串:'?'之后的值作为页面网址。

 http://www.codeproject.com/Questions/811654/How-to-get-the-text-box-value-form-one -page-to-ano?arn = 4 

arn 是变量名称, 4 是值。

http://msdn.microsoft.com/en-us/library/system.web.httprequest.querystring(v = vs.110).aspx [ ^ ]

2)Cookies:存储在客户端,它们可以被服务器恢复并用于新的页面加载事件。

http://msdn.microsoft.com/en-us/library/aa287547(v = vs.71)的.aspx [< a href =http:// msdn.microsoft.com/en-us/library/aa287547(v=vs.71).aspx\"target =_ blanktitle =新窗口> ^ ]

< a href =http://msdn.microsoft.com/en-us/library/aa287533(v=vs.71).aspx> http://msdn.microsoft.com/en-us/library/aa287533( v = vs.71).aspx [ ^ ]

3)会话:存储在服务器上。

http://msdn.microsoft.com/en-us/library/system.web.httpcontext.session (v = vs.110).aspx [ ^ ]


Google搜索在页面asp.net之间传递数据



您可以尝试微软的方法(第一个链接): http://msdn.microsoft.com/ en-us / library / vstudio / 6c3yckfw(v = vs.100).aspx [ ^ ]



其他方法(第3个链接): http://www.itorian.com/2012/07/ 5-way-to-data-between-aspnet-pages.html [ ^ ]



我建议你阅读以下内容链接:

你有什么尝试? [ ^ ]

如何提问? [ ^ ]



它们将帮助您改善问题,从而获得更好的答案。

Hi guys!

In my first page, I have 2 text boxes and a button. the first one is for username and the other one for the id. What I want to do is that, the text box value will be get from the first page and it will be display inside the text box on the next page after the user clicks the button. How to do that?

解决方案

There are three ways:
1) Query string: values after a '?' as part of the page URL.

http://www.codeproject.com/Questions/811654/How-to-get-the-text-box-value-form-one-page-to-ano?arn=4

arn is the variable name, 4 is the value.
http://msdn.microsoft.com/en-us/library/system.web.httprequest.querystring(v=vs.110).aspx[^]
2) Cookies: stored on the client, they can be recovered by the server and used in the new page load event.
http://msdn.microsoft.com/en-us/library/aa287547(v=vs.71).aspx[^]
http://msdn.microsoft.com/en-us/library/aa287533(v=vs.71).aspx[^]
3) Session: stored on the server.
http://msdn.microsoft.com/en-us/library/system.web.httpcontext.session(v=vs.110).aspx[^]


Googling "passing data between pages asp.net"

You can try microsoft's approach (First link): http://msdn.microsoft.com/en-us/library/vstudio/6c3yckfw(v=vs.100).aspx[^]

Other approaches (3rd Link): http://www.itorian.com/2012/07/5-ways-to-send-data-between-aspnet-pages.html[^]

I would recommend you to read following links too:
What have you tried?[^]
How to ask a question?[^]

They will help you improve your questions and hence get better answers.


这篇关于如何将文本框值从一个页面转换到另一个页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆