Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had the same issue and found this topic when i was looking for the solution. I found it so I will post it to help developers who could have the same issue.</p> <p>Implement the IPostBackEventHandler interface in your UserControl :</p> <pre><code>Public Class UserControl_Rattachement Inherits System.Web.UI.UserControl Implements ICallbackEventHandler, IPostBackEventHandler </code></pre> <p>In the RaisePostBackEvent function, call the Update() method of your UpdatePanel :</p> <pre><code>Public Sub RaisePostBackEvent(eventArgument As String) Implements System.Web.UI.IPostBackEventHandler.RaisePostBackEvent // Code executed during the PostBack UpdatePanel1.Update() End Sub </code></pre> <p>In the Page_Load method of your UserControl, define the PostBack as asynchronous :</p> <pre><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load ScriptManager.GetCurrent(Page).RegisterAsyncPostBackControl(Me) End Sub </code></pre> <p>Now add the client script in the Render method :</p> <pre><code>Protected Overrides Sub Render(writer As System.Web.UI.HtmlTextWriter) MyBase.Render(writer) Dim postbackReference As String = Page.ClientScript.GetPostBackEventReference(Me, Nothing, True) Dim postbackScript As String = String.Format("function updateRattachement() {{ {0}; }}", postbackReference) writer.WriteLine("&lt;script type=""text/javascript""&gt;") writer.WriteLine(postbackScript) writer.WriteLine("&lt;/script&gt;") End Sub </code></pre> <p>Then, call your client side function when you need it :</p> <pre><code>updateRattachement(); </code></pre> <p>The PostBack will be asynchronous, and this will refresh the UpdatePanel you specified.</p> <p>I hope this will help, and sorry for my english.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload