无法更新文本框文本 [英] cant update textbox text
本文介绍了无法更新文本框文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的问题。第一页我从网格获得第一行记录并将行记录发送到下一页并显示。然后我无法更新它。我发现更新 - textbox.text不可编辑
my problem. 1st page i get 1st row record from grid and send the row record to next page and it show . then i cant update it . i found update - textbox.text not editable
推荐答案
嗨伙计们我发现了问题..我把回合功能与回发
public void showDeal()
{
int did = Convert.ToInt16(Request.QueryString [sid]);
if(did == null)
{
string msg =;
msg =< script> alert (''不'')< / script> +做了;
ScriptManager.RegisterClientScriptBlock(this,typeof(Page),alert,msg,false);
}
其他
{
co.Open();
string s =select * from PS_deals where did =''+ did +'';
SqlCommand cm = new SqlCommand(s,co);
cm.ExecuteNonQuery();
SqlDataAdapter sd = new SqlDataAdapter(cm);
DataSet dt = new DataSet();
sd.Fill(dt);
if(dt.Tables [0] .Rows.Count> 0)
{
txt_dname.Text = dt.Tables [0] .Rows [0] [dealname]。ToString();
txt_descp.Text = dt.Tables [0] .Rows [0] [description]。ToString();
txt_validfrom.Text = dt.Tables [0] .Rows [0] [validfrom]。ToString();
txt_validto.Text = dt.Tables [0] .Rows [0] [validto]。ToString();
drp_nit.Items [0] .Text = dt.Tables [0] .Rows [0] [night]。ToString();
drp_roomtype.Items [0] .Text = dt。 Tables [0] .Rows [0] [roomtype]。ToString();
txt_price.Text = dt.Tables [0] .Rows [0] [price]。ToString( );
}
dt.Dispose();
co.Close();
}
}
hi guys i found the problem.. i put bind function with in postback
public void showDeal()
{
int did = Convert.ToInt16(Request.QueryString["sid"]);
if (did == null)
{
string msg = "";
msg = "<script>alert(''No'')</script>+did";
ScriptManager.RegisterClientScriptBlock(this, typeof(Page), "alert", msg, false);
}
else
{
co.Open();
string s = "select * from PS_deals where did=''" + did + "'' ";
SqlCommand cm = new SqlCommand(s, co);
cm.ExecuteNonQuery();
SqlDataAdapter sd = new SqlDataAdapter(cm);
DataSet dt = new DataSet();
sd.Fill(dt);
if (dt.Tables[0].Rows.Count > 0)
{
txt_dname.Text = dt.Tables[0].Rows[0]["dealname"].ToString();
txt_descp.Text = dt.Tables[0].Rows[0]["description"].ToString();
txt_validfrom.Text = dt.Tables[0].Rows[0]["validfrom"].ToString();
txt_validto.Text = dt.Tables[0].Rows[0]["validto"].ToString();
drp_nit.Items[0].Text = dt.Tables[0].Rows[0]["night"].ToString();
drp_roomtype.Items[0].Text = dt.Tables[0].Rows[0]["roomtype"].ToString();
txt_price.Text = dt.Tables[0].Rows[0]["price"].ToString();
}
dt.Dispose();
co.Close();
}
}
这篇关于无法更新文本框文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文