如何将值传递到下一页,以及如何使用下一页中的值?我想将名称从第一页传递到下一页。 [英] How do I pass the value into the next page, and how do I use the value in the next page? I want to pass an name from the first page to the next.

查看:145
本文介绍了如何将值传递到下一页,以及如何使用下一页中的值?我想将名称从第一页传递到下一页。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将值传递到下一页,以及如何在下一页中使用该值?我想将名字从第一页传递到下一页。



i想要使用session

How do I pass the value into the next page, and how do I use the value in the next page? I want to pass an name from the first page to the next.

i want to use session

推荐答案

参考:如何:在ASP.NET网页之间传递值 [ ^ ]


使用状态管理技术。请看下面的链接,你可以得到一个清晰的想法。

http://msdn.microsoft.com/en-us/library/75x4ha6s.ASPX [ ^ ]

http://www.c-sharpcorner.com/UploadFile/78d182/Asp-Net-state-management-techniques/ [ ^ ]

ASP.Net状态管理技术 [ ^ ]
use state management techniques.see the below links you can get a clear idea.
http://msdn.microsoft.com/en-us/library/75x4ha6s.ASPX[^]
http://www.c-sharpcorner.com/UploadFile/78d182/Asp-Net-state-management-techniques/[^]
ASP.Net State Management Techniques[^]


在服务器端你可以使用session

例如:网页1



会话[名称] = textbox.text;



你可以通过'


获取此值。
string name = Session [name];





在客户端你可以使用Querystring,hiddenfield,Viewstate等



例如:Querystring



page1:Response.Redirect(page2.aspx?name ='+ textbox2.text +');




第2页的
;

字符串名称= Request.Querystring [name]。tostring();
In server side you can use session
eg: webpage1

Session["name"]=textbox.text;

you can access this value in page 2 by'

string name=Session["name"];


in client side you can use Querystring,hiddenfield,Viewstate etc

eg: Querystring

page1: Response.Redirect("page2.aspx?name='"+ textbox2.text +"'");


in page 2;
string name=Request.Querystring["name"].tostring();


这篇关于如何将值传递到下一页,以及如何使用下一页中的值?我想将名称从第一页传递到下一页。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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