Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
340
Exempting control from Async tab
posted

I have AsyncMode="On" and need to exempt certin buttons from doing a partial postback. How would I go about doing that?

I know with an UpdatePanel you can just add a trigger for the button, but I dont see such a property on UltraWebTab

Parents
No Data
Reply
  • 24497
    Suggested Answer
    posted

    Hi,

    Similar features has WebAsyncRefreshPanel, so you may consider to use it instead of async options of tab.

    It is also possible to work around that issue within events of UltraWebTab.
    You may process ClientSideEvents.BeforeAsyncSubmit, check for trigger-control and raise full postback by oEvent.fullPostBack = true;
    If you need to process event hadler on server for that trigger-control, then you need extra work. Below example will keep async postback for Button1 and trigger full postback for Button2. It also will "fake" call to the Button2_Click by setting a flag for one of the global fields on client and checking value of that field on server.
    Codes in aspx:
    <script type="text/javascript">
    function UltraWebTab1_BeforeAsyncSubmit(oWebTab, notUsed, oEvent, id)
    {
     if(id == '<%=Button2.ClientID%>')
     {
      oEvent.fullPostBack = true;
      var elem = document.getElementById('__EVENTTARGET');
      if(elem)
       elem.value = id;
     }
    }
    </script>
     <igtab:UltraWebTab ID="UltraWebTab1" runat="server" AsyncMode="On">
      <ClientSideEvents BeforeAsyncSubmit="UltraWebTab1_BeforeAsyncSubmit" />
      <Tabs>
       <igtab:Tab Text="Tab 1">
        <ContentTemplate>
         <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
         <asp:Button ID="Button2" runat="server" Text="Button" onclick="Button2_Click" />
        </ContentTemplate>
       </igtab:Tab>
      </Tabs>
     </igtab:UltraWebTab>

    Codes in cs:
    protected void Page_Load(object sender, EventArgs e)
    {
      if(this.IsPostBack)
      {
       string id = this.Request.Form["__EVENTTARGET"];
       if(!string.IsNullOrEmpty(id) && id.Equals(this.Button2.ClientID))
        this.Button2_Click(this.Button2, new EventArgs());
      }
    }

Children
No Data