2016-03-03 73 views
-4

**如何在asp.net中将数据从一个页面传输到另一个页面,我不想要使用会话的 **如何在asp.net中将数据从一个页面传输到另一个页面,我不想使用会话

+0

您可以使用查询字符串.. – RajeeshMenoth

+3

的可能的复制[如何将数据传输到另一个页面(http://stackoverflow.com/questions/5987469/how-将数据传输到另一页) – Alexis

+0

不,它不是我想的,因为我想问是否有任何其他的alternet选项,因为查询字符串使用起来不是很安全。此外,如果用户清除Cookies,然后到它的一个大问题 –

回答

0

您可以使用查询字符串&饼干

的查询字符串例子:

传递价值..

private void Button1_Click(object sender, System.EventArgs e) 
{ 
// Value sent using HttpResponse 
Response.Redirect("Form1.aspx?Name="+txtName.Text); 
} 

使用查询字符串中获得价值..

if (Request.QueryString["Name"]!= null) // null checking 
lbl_Name.Text = Request.QueryString["Name"]; 
+0

感谢您的迅速行动,但可以建议任何其他的alternet选项作为查询字符串是不是很安全的使用。此外,如果用户清除Cookies,那么就是一个很大的问题。 –

+0

会话更安全,请参考http://www.itorian.com/2012/07/5-ways-to-send-data-between-aspnet-pages.html – RajeeshMenoth

+0

我听说会话使页面更加繁重,真的吗?否则请纠正我 –

相关问题