<a href='followvisitAdd.aspx?Id=<%#Eval("contentid") %>&followupcontent=<%#Eval("Followupcontent") %>&followupresult=<%#Eval("Followupresults") %>'><asp:Label ID="update" runat="server" Text="修改"></asp:Label></a>int conid = Utils.GetQueryInt("contentid");
            string follcon = Utils.GetQueryString("followupcontent");
            string follres = Utils.GetQueryString("followupresults");
            Updfollowup(conid,follcon,follres);
我想从上面连接中传到后台参数,然后填充textbox,然后点击按钮进行修改功能,不知道怎么把传过来的数据填充到textbox中,并传到方法中

解决方案 »

  1.   

    string aaa=Request["Id"].ToString();
    string bbb=Request["followupcontent"].ToString();
    string ccc=Request["followupresult"].ToString();
    ......
      

  2.   


    这个传过来的数值能显示在textbox上吗?
      

  3.   

    将textbox 的Text 绑定你传递过来的值 就OK了 
      

  4.   

    //目标页面
    if(!ispostback)
    {
        TextBox1.Text=Request["Id"].ToString();
        TextBox2.Text=Request["followupcontent"].ToString();
        TextBox3.Text=Request["followupresult"].ToString();
    }
    //这样子可不可以
      

  5.   


    TextBox2.Text=Request["followupcontent"].ToString();
    如果前面写成这样,那我怎么将值传到方法中?
      

  6.   

    你看,你都已经把值取出来了,直接当做参数传到方法里不就行了
    比如
    //一个方法
    public void GetMoney(string aaa,string bbb)
    {
         //方法里面的一些操作
          ......
    }方法GetMoney 需要两个字符串类型的参数 那么调用他的时候可以如此:
    //取值
    string strAbc=TextBox1.Text;
    string strDef=TextBox2.Text;
    //调方法
    GetMoney(strAbc,strDef);
      

  7.   


    我实现的是修改功能,我要在另外一个页面点击修改后弹到另外一个页面,然后数值显示在textbox中,等待我修改,修改后点击确认提交。
      

  8.   


    public int Updfollowup(int UpId, string con, string res)
            {            string sql = "update health_user_followup_content set followupcontent='" + con + "',followupresults='" + res + "' where contentid='" + UpId + "'";
                int count = intExecuteSql(sql);
                return count;
            }
    这个是我的方法
      

  9.   


    textbox中不显示数据,修改也无效
      

  10.   

    你先判断Request["followupcontent"].ToString()这些传过来的值是不是空的,是空的 肯定就是没有传过来,不是空的就把他付给 文本框
      

  11.   

            if (this.txtcontant.Text.Trim() != null || this.txtresults.Text.Trim() != null)
            {
                int conid = Utils.GetQueryInt("contentid");
                this.txtcontant.Text = Request["followupcontent"].ToString();
                this.txtresults.Text = Request["followupresults"].ToString();
                string follcon = txtcontant.Text;
                string follres = txtresults.Text;
                Updfollowup(conid,follcon,follres);
      

  12.   

    if (this.txtcontant.Text.Trim() != "" || this.txtresults.Text.Trim() != "")
       {
       int conid = Utils.GetQueryInt("contentid");
       this.txtcontant.Text = Request["followupcontent"].ToString();
       this.txtresults.Text = Request["followupresults"].ToString();
       string follcon = txtcontant.Text;
       string follres = txtresults.Text;
       Updfollowup(conid,follcon,follres);
      

  13.   


    我是不是应该把显示内容赋值到textbox中写在Page_Load中