传递查询字符串 [英] Passing Query String
本文介绍了传递查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在asp.net C#2010
How Can I sent veritable One Page to another page in asp.net C# 2010
推荐答案
中将真正的单页发送到另一页?我认为你的意思是说变量而不是名副其实?如果这是所以,请参阅下面的链接,了解加密查询字符串。
加密查询字符串
I think you mean to say variable rather than veritable?if this is so,refer to link below to get idea about encrypting query strings.
Encrypting Query Strings
Response.Redirect(YourPage.aspx?xyz = YourVariableValue);
现在一旦重定向到你的页面,在page_load事件中你可以从xyz对象中检索传递的值,如下所示:
Response.Redirect("YourPage.aspx?xyz=YourVariableValue");
Now once redirected to your page, in the page_load event you can retrive the passed value from xyz object like below:
if(Request["xyz"] != null)
{
string myString = Convert.ToString(Request["xyz"]); //If the datatype of the value is a string.
}
简单
使用
Response.Redirect(pagename.aspx?id = 2)
你可以使用
字符串来获得该值a = Request.QueryString [id];
pagename.aspx上的
its simple
using
Response.Redirect("pagename.aspx?id=2")
and u can get that value using
string a=Request.QueryString["id"];
at pagename.aspx
这篇关于传递查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文