protected string GetDing(string ding, string id, string table)
    {
        return "<input name=" + table + id + " type=text id=" + table + id + " value=" + ding + " style='width:50px' /><a href='?id=" + id + "&abc=ding&table=" + table + "'><font color='red'>置顶</font></a>";
    }Request.Form[Request.QueryString["table"] + Request.QueryString["id"]]这样为何取不到值?应该如何取?

解决方案 »

  1.   

    Request.Form["+ table + id +他的值就可以了"]
      

  2.   

    Request.Form["name="+ table + id +""]//取的是name属性
      

  3.   


    不行啊,是不是哪里有错误?我用Request.Form[0]会报出空指针异常。
      

  4.   

    Request.Form接收的是表单传过来的~Request.QueryString接收的是url传过来的~~
      

  5.   

    aspx页面代码:
    <input id="Text1" name="myText1" type="text" value="aaaaa" />c#代码
    string a = (Request.Form["myText1"]).ToString();
    注意用input中的name