<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中,并传到方法中
string follcon = Utils.GetQueryString("followupcontent");
string follres = Utils.GetQueryString("followupresults");
Updfollowup(conid,follcon,follres);
我想从上面连接中传到后台参数,然后填充textbox,然后点击按钮进行修改功能,不知道怎么把传过来的数据填充到textbox中,并传到方法中
string bbb=Request["followupcontent"].ToString();
string ccc=Request["followupresult"].ToString();
......
这个传过来的数值能显示在textbox上吗?
if(!ispostback)
{
TextBox1.Text=Request["Id"].ToString();
TextBox2.Text=Request["followupcontent"].ToString();
TextBox3.Text=Request["followupresult"].ToString();
}
//这样子可不可以
TextBox2.Text=Request["followupcontent"].ToString();
如果前面写成这样,那我怎么将值传到方法中?
比如
//一个方法
public void GetMoney(string aaa,string bbb)
{
//方法里面的一些操作
......
}方法GetMoney 需要两个字符串类型的参数 那么调用他的时候可以如此:
//取值
string strAbc=TextBox1.Text;
string strDef=TextBox2.Text;
//调方法
GetMoney(strAbc,strDef);
我实现的是修改功能,我要在另外一个页面点击修改后弹到另外一个页面,然后数值显示在textbox中,等待我修改,修改后点击确认提交。
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;
}
这个是我的方法
textbox中不显示数据,修改也无效
{
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);
{
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);
我是不是应该把显示内容赋值到textbox中写在Page_Load中