Exclude control from ajaxifying

2 posts, 0 answers
  1. kevin
    kevin avatar
    7 posts
    Member since:
    Aug 2016

    Posted 22 Nov 2016 Link to this post

    I am unable to exclude ajax enabled control (Button2) that resides inside panel (PanelButtons) as shown below. I tried to use the following code, I don't get any errors, but the button click is not working. I tried by using RadScriptManager's RegisterPostBackControl method. I also tried to disable AJAX via the OnRequestStart event as well as InitializeRequest event. None of them seems to work. So, is there any better solution for this scenario? Thanks.

      <asp:Content runat="server" ContentPlaceHolderID="Content1">
       <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
       <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
         <UpdatedControls>             
          <telerik:AjaxUpdatedControl ControlID="RadWindow1" />    
          <telerik:AjaxUpdatedControl ControlID="PanelButtons" />
         </UpdatedControls>
        </telerik:AjaxSetting>
        </AjaxSettings>
     </telerik:RadAjaxManagerProxy>
      <telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource">
        <MasterTableView>
         <Columns>                  
         </Columns>
        </MasterTableView>
        <ClientSettings EnablePostBackOnRowClick="false" >
         <Selecting AllowRowSelect="true" />
         <ClientEvents OnRowClick="openRadWindow" OnRowSelected="RadGrid1_RowSelect" />
        </ClientSettings>       
     </telerik:RadGrid>
      <telerik:RadWindow ID="RadWindow1" runat="server" >
       <ContentTemplate>
       <div>...</div>
          <asp:Panel ID="PanelButtons" runat="server">
         <telerik:RadButton ID="Button1" Text="Save" runat="server">
         <telerik:RadButton ID="Button2" Text="Save" runat="server" OnClientClicking="Button2_Click"
            OnClick="Button2_Click" AutoPostBack="false">
         <telerik:RadButton ID="Button3" Text="Save" runat="server">
         <telerik:RadButton ID="Button4" Text="Save" runat="server">
        </asp:Panel>
       </ContentTemplate>
     </telerik:RadWindow>
    </asp:Content>
     <telerik:RadCodeBlock runat="server">       
     <script type="text/javascript">
      
     function pageLoad()
     {
      win = $find("<%= RadWindow1.ClientID %>");
     }
     function openRadWindow() {
      win.show(); 
     }
     
     function Button2_Click()
     {
      __doPostBack("<%= Button2.ClientID %>", "");
     }
     </script>
    </telerik:RadCodeBlock>

    Server side:

    protected void Page_Load(object sender, EventArgs e)
    {

       var mngr = RadScriptManager.GetCurrent(this.Page);   

         mngr.RegisterPostBackControl(Button2);

    }

     

  2. kevin
    kevin avatar
    7 posts
    Member since:
    Aug 2016

    Posted 22 Nov 2016 in reply to kevin Link to this post

    FYI I tried wrapping <asp:Panel> inside <telerik:RadAjaxPanel> , it does seems to work. But I don't want to wrap inside RadAjaxPanel. Thanks.

  3. kevin
    kevin avatar
    7 posts
    Member since:
    Aug 2016

    Posted 22 Nov 2016 Link to this post

    I have fixed the issue using initializeRequest event. thanks.
Back to Top