Wednesday, 19 June 2013

Reponse.Redirect response from server is very slow in asp.net

Reponse.Redirect response from server is very slow in asp.net

 

To overcome from this issue please set your scriptmanager or Toolkitscriptmanager time out value to high

<asp:ScriptManager ID="ScriptManager1" AsyncPostBackTimeOut="36000" runat="server">

Tuesday, 18 June 2013

Asynchronus postback using gridview linkbutton inside Updatepanel


 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

LinkButton lblTrainigEdit = e.Row.FindControl("lblTrainigEdit") as LinkButton;

ToolkitScriptManager.GetCurrent(this).RegisterAsyncPostBackControl(lblTrainigEdit);

}