当前位置: 代码迷 >> ASP.NET >> request如何获取变量参数的值
  详细解决方案

request如何获取变量参数的值

热度:7133   发布时间:2013-02-25 00:00:00.0
request怎么获取变量参数的值?
就是说参数是动态的      
    比如      
    string       a= "123 "      
    Request.Form[a]这样的如何写?      
    谢了

------解决方案--------------------------------------------------------
Request.Form[a]就可以了.
------解决方案--------------------------------------------------------
string _temp;
if(Request.Form[a] != null && Request.Form[a].ToString() != string.Empty)
{
_temp = Request.Form[a].ToString();
}
------解决方案--------------------------------------------------------
楼主的意思是[]里面的参数名是动态的?没关系,直接Request.Form[a]即可。
  相关解决方案