<asp:Repeater ID="shipingo" runat="server">
<ItemTemplate>
<asp:Label ID="l_id" runat="server" Text=<%#Eval("biaoti") %>></asp:Label><asp:TextBox ID="tb_qty" Text="" runat="server" Width="493px"></asp:TextBox><br />
</ItemTemplate>
</asp:Repeater>
<asp:Button ID="Button1" runat="server" Height="84px" OnClick="Button1_Click" Text="更 新" Width="174px" />
后臺
protected void Button1_Click(object sender, EventArgs e)
{
List<string> SQLS = new List<string>();
foreach (RepeaterItem dlItem in shipingo.Items)//遍歷每一行資料
{
TextBox tb_qty = dlItem.FindControl("tb_qty") as TextBox;
Label l_id = dlItem.FindControl("l_id") as Label;
SQLS.Add(
"Update ProposedOrdering Set QTY=@qty Where ID=@id"
.Replace("@qty", tb_qty.Text)
.Replace("@id", l_id.Text)
);
}
//SqlDbHelper.ExecuteSqlTran(SQLS);
//DataListDataBind();
}
我在 TextBox tb_qty 填寫東西以后 點擊按鈕 到后臺以后 獲取到的值 都是"" 只能獲取到修改之前的值 修改后 點擊按鈕 獲取到的值 還是修改前的 感覺就是又重繪一了一次 怎么處理呢?
uj5u.com熱心網友回復:
知道了 要用 IsPostBack轉載請註明出處,本文鏈接:https://www.uj5u.com/net/132229.html
標籤:ASP.NET
上一篇:大家指導一下啦
