如何在asp.net中使用查询字符串。asp.net中的查询字符串
5
A
回答
7
这取决于究竟query.string你指的是语言做了,但是......
Request.QueryString["MyValue"];
http://msdn.microsoft.com/en-us/library/system.web.httprequest.querystring.aspx
2
Request.QueryString["StringValue"];
2
0
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>asp.net QueryString example: how to use QueryString</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2 style="color:Navy">QueryString Example</h2>
<asp:HyperLink
ID="HyperLink1"
runat="server"
NavigateUrl="~/Image.aspx?ImageID=1&ImageName=Elephant"
Text="Test QueryString"
>
</asp:HyperLink>
</div>
</form>
你也可以使用按钮单击事件,而不是页面加载。
protected void Page_Load(object sender, System.EventArgs e) {
string ID = Request.QueryString["ImageID"];
string Name = Request.QueryString["ImageName"];
Label1.Text = "ImageID: "+ ID;
Label2.Text = "Image name: "+ Name;
Image1.ImageUrl = "~/Images/"+Name+".jpg";
}
相关问题
- 1. Asp.Net查询字符串
- 2. ASP.NET查询字符串
- 3. ASP.NET查询子字符串
- 4. 从asp.net中删除查询字符串
- 5. 查询字符串的ASP.NET URL重写
- 6. ASP.Net查询字符串超时
- 7. ASP.NET MVC:URL路由与查询字符串
- 8. Url用ASP.NET查询字符串重写
- 9. ASP.NET System.Web.Routing和查询字符串参数
- 10. ASP.NET MVC - 重写FormMethod.Get查询字符串?
- 11. asp.net查询字符串数据绑定
- 12. 查询字符串在asp.net MVC 2
- 13. ASP.NET查询字符串第二个值
- 14. ASP.NET MVC路由和查询字符串
- 15. ASP.NET查询字符串没有等号
- 16. 查询字符串
- 17. 查询字符串
- 18. 使用查询字符串查询字符串列表?
- 19. 为什么我的ASP.NET MVC路由中的查询字符串?
- 20. Python的查询(字符串)
- 21. servlet的查询字符串
- 22. jQuery的查询字符串
- 23. 动态linq查询由于asp.net mvc中的查询字符串c#
- 24. 我需要验证在asp.net中的查询字符串
- 25. 在asp.net中需要关于查询字符串的帮助
- 26. 如何删除查询字符串中的空参数asp.net mvc
- 27. 如何在asp.net中保护/加密你的查询字符串?
- 28. 如何处理asp.net web api中的查询字符串参数
- 29. 在ASP.NET中使用查询字符串的最佳做法?
- 30. 如何访问asp.net mvc中的查询字符串参数?