如何在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中的查询字符串错误
- 6. 从asp.net中删除查询字符串
- 7. 查询字符串的ASP.NET URL重写
- 8. C#asp.net图片廊查询字符串
- 9. ASP.Net查询字符串超时
- 10. ASP.NET System.Web.Routing和查询字符串参数
- 11. Url用ASP.NET查询字符串重写
- 12. asp.net查询字符串数据绑定
- 13. ASP.NET MVC - 重写FormMethod.Get查询字符串?
- 14. ASP.NET MVC路由和查询字符串
- 15. Asp.net MVC 3全局查询字符串?
- 16. 显示查询字符串asp.net
- 17. 填表与ASP.NET MVC查询字符串
- 18. ASP.NET MVC RedirectToAction查询字符串
- 19. ASP.NET查询字符串第二个值
- 20. ASP.NET查询字符串没有等号
- 21. 隐藏查询字符串MVC3 -ASP.NET
- 22. Asp.Net MVC加密查询字符串
- 23. 查询字符串在asp.net MVC 2
- 24. ASP.NET MVC:URL路由与查询字符串
- 25. 重定向查询字符串的URL非查询字符串
- 26. 查询字符串的查询字符串
- 27. 查询字符串
- 28. 查询字符串
- 29. 查询字符串
- 30. 查询字符串