如何读取asp.net页面传递的参数,使用C#? [英] How to read parameter passed from asp.net page, using C#?
本文介绍了如何读取asp.net页面传递的参数,使用C#?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是新来ASP.net,我怎么能读取ASP.net页面(的 http://website.com/index.aspx?id=12&nam=eee )。
I'm new to ASP.net, how can I read parameters passed from ASP.net page (http://website.com/index.aspx?id=12&nam=eee).
任何一个小例子将是。感激,只是我的东西从启动
Any small example will be appreciated, just something for me to start from.
推荐答案
使用您的样本网址:
string id = Request.QueryString["id"];
string nam = Request.QueryString["nam"];
阅读有关的 MSDN上的Request.QueryString。你可能想在 ID
值转换为int。
Read about Request.QueryString on MSDN. You probably want to convert the id
value to an int.
这篇关于如何读取asp.net页面传递的参数,使用C#?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文