Avoid Full postback triggered by LinkButton inside GridView inside UpdatePanel
// Changing the format of the date to show on edit modeif (e.Row.RowState == DataControlRowState.Edit || e.Row.RowState == (DataControlRowState.Edit | DataControlRowState.Alternate)){
e.Row.BackColor =
Color.White;
TextBox editingFromDate = (TextBox)e.Row.FindControl("txtEditFromDate");
DateTime fromDate = Convert.ToDateTime(editingFromDate.Text);((
TextBox)e.Row.FindControl("txtEditFromDate")).Text = fromDate.Date.ToString("dd/MM/yyyy");
TextBox editingToDate = (TextBox)e.Row.FindControl("txtEditToDate");
DateTime toDate = Convert.ToDateTime(editingToDate.Text);((
TextBox)e.Row.FindControl("txtEditToDate")).Text = toDate.Date.ToString("dd/MM/yyyy");
// Registerting the controls for asynchronus postback in edit mode
LinkButton lblTrainigUpdate = e.Row.FindControl("lblTrainigUpdate") as LinkButton;
ToolkitScriptManager.GetCurrent(this).RegisterAsyncPostBackControl(lblTrainigUpdate);
LinkButton lblTrainigCancel = e.Row.FindControl("lblTrainigCancel") as LinkButton;
ToolkitScriptManager.GetCurrent(this).RegisterAsyncPostBackControl(lblTrainigCancel);
}else{
// Registerting the controls for asynchronus postback in normal case
No comments:
Post a Comment