Asp.net: exclude control in updatepanel from async postback

I placed the user control inside the update panel after after the asynchronous postback of the js file associated with the page this user control does not work, so there is some method for excluding the control from the update panel in another word that I don’t want Publish this user control.

<asp:UpdatePanel ID="upPnlAnswerList" runat="server"> <ContentTemplate> // another code that required to placed inside updatepanel <div id="miancontainer" class="containerr" <klmsuc:Share ID="shareUserControl" runat="server" /> // another code that required to placed inside updatepanel </div> 
+4
source share
3 answers

Set UpdateMode = Conditional and provide exclusive triggers for UpdatePanel.

See: http://msdn.microsoft.com/en-us/library/bb386454.aspx

0
source

Use PostBackTrigger to throw an exception, not to indicate a large number of inclusions.

 <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:LinkButton ID="lnkExport" runat="server" OnClick="lnkExport_Click" Text="Export Data"></asp:LinkButton> </ContentTemplate> <Triggers> <asp:PostBackTrigger ControlID="lnkExport" /> </Triggers> </asp:UpdatePanel> 
+11
source

you have to add some controls to the code behind and in the correct event and register it instead of the exception (postback) and AsyncPostBack, which is an ajax call.

ScriptManager.GetCurrent (this) .RegisterPostBackControl (btnAdd);

fooobar.com/questions/1331372 / ...

 protected void grdExpense_RowCreated(object sender, GridViewRowEventArgs e) { LinkButton btnAdd = (LinkButton)e.Row.Cells[0].FindControl("btnAdd"); if (btnAdd != null) { ScriptManager.GetCurrent(this).RegisterPostBackControl(btnAdd); } } 

find another similar page that excludes all controls in gridview

http://www.aspsnippets.com/Articles/Assign-PostBack-Trigger-Full-PostBack-for-LinkButton-inside-GridView-within-AJAX-UpdatePanel-in-ASPNet.aspx

 private void RegisterPostBackControl() { foreach (GridViewRow row in GridView1.Rows) { LinkButton lnkFull = row.FindControl("lnkFull") as LinkButton; ScriptManager.GetCurrent(this).RegisterPostBackControl(lnkFull); } } 
0
source

All Articles