如何动态地向网址添加查询字符串? [英] How to add querystring dynamically to the url ?
本文介绍了如何动态地向网址添加查询字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一些菜单......网站地址仅来自数据库。
我在尝试什么要做的是..有几页我想从不同的菜单访问..而不是一次又一次地创建相同的页面...我在想的是...调用相同的页面..如果经理员工点击..我想将管理员ID添加到网址并传递到该页面,这将相应地告诉我详细信息..
Hi ,
I have some menus .. and the address of website is coming from database only .
What i am trying to do is .. there are few pages which i want to access from different menus .. instead of creating same pages again and again ... what i am thinking is .. call the same page .. and if the manager employees is click .. i want to add mangers id to the url and pass to that page which will accordingly shoe me the details ..
推荐答案
//使用c#
Response.Redirect(Sample.aspx?id = 1); // id是查询名称
//从查询字符串中检索值
string qrystr = Request.QuerString [id]。ToString();
//Create Querystring using c#
Response.Redirect("Sample.aspx?id=1"); //id is the query name
//Retrieve value from Query string
string qrystr=Request.QuerString["id"].ToString();
这篇关于如何动态地向网址添加查询字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文