0
我在asp.net新我使用LINQ與按鈕單擊事件asp.net我的GridView重新綁定沒有數據是GridView控件到UpdatePanel的ASP.Net的GridView重新綁定不上的按鈕,點擊數據
「> 「>
protected void btnSave_Click(object sender, EventArgs e)
{
foreach (GridViewRow gvr in gvClientData.Rows)
{
if (((CheckBox)gvr.FindControl("chkdisplay")).Checked == true)
{
string Index = ((Label)gvr.FindControl("lblIndex")).Text;
int GIIndex = Convert.ToInt32(Index);
GI_InsureMaster insertclientinfo = vjdb.GI_InsureMasters.Single(upd => upd.GIMastIndex == GIIndex);
insertclientinfo.SendToCompany = true;
vjdb.SubmitChanges();
}
}
BindAgencyData();
Response.Redirect(Request.RawUrl);
}
您在代碼中留下了更重要的方法'BindAgencyData'。 – Habib
「重新綁定數據」是什麼意思?如果您在保存方法中缺少數據,請記住,您必須重新綁定page_load中的gridview。 – Schadensbegrenzer