This is a migrated thread and some comments may be shown as answers.

Exclude control from ajaxifying

2 Answers 64 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
kevin
Top achievements
Rank 1
kevin asked on 22 Nov 2016, 04:45 PM

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 Answers, 1 is accepted

Sort by
0
kevin
Top achievements
Rank 1
answered on 22 Nov 2016, 04:52 PM

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

0
kevin
Top achievements
Rank 1
answered on 22 Nov 2016, 05:33 PM
I have fixed the issue using initializeRequest event. thanks.
Tags
General Discussions
Asked by
kevin
Top achievements
Rank 1
Answers by
kevin
Top achievements
Rank 1
Share this question
or