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

Un-ajaxifying dynamically loaded user control

1 Answer 79 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
20Below
Top achievements
Rank 1
20Below asked on 17 Apr 2011, 01:32 AM
Hi,
I'm new to this project and to RadControls so please bare with me. I have a button that when clicked I need to return back a dynamically created document from the server. However, the button is contained with in a user control (ascx) which is apparently dynamically loaded within an asp:panel. I don't exactly understand how this is implemented but here is some of the markup code from the aspx page:
<telerik:RadAjaxManager ID="ajaxManager" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
        onajaxrequest="ajaxManager_AjaxRequest"
        UpdatePanelsRenderMode="Inline">
        <ClientEvents OnRequestStart="centerLoadingPanel"></ClientEvents>
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="ajaxManager">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="infoBar" />
                    <telerik:AjaxUpdatedControl ControlID="errorPanel" />
                    <telerik:AjaxUpdatedControl ControlID="contentScreenPanel" />
                    <telerik:AjaxUpdatedControl ControlID="tabStrip" />
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="errorPanel">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="errorLabel" />
                    <telerik:AjaxUpdatedControl ControlID="editMode" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="infoBar">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="screenOverviewPanel" />
                    <telerik:AjaxUpdatedControl ControlID="toolBarPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ToolBarControl1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="contentScreenPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="screenOverviewPanel">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lblScreenTitle" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

Somewhere later in the same aspx page we have the following code:
<telerik:RadPane runat="Server" ID="lowerContentPane" Scrolling="Both" Width="100%" Height="542">
                            <asp:Panel ID="errorPanel" runat="server">
                                <asp:Label ID="errorLabel" ForeColor="Red" runat="server"></asp:Label>
                                <asp:HiddenField runat="server" ID="editMode" />
                            </asp:Panel>
                            <asp:Panel ID="contentScreenPanel" runat="server"></asp:Panel>
                        </telerik:RadPane>

So it seems that the ascx pages are loaded into the contentScreenPanel.  I don't want to disable ajax for the contentScreenPanel control because that will affect all content loaded in it. I'm wanting to disable ajax for a button within a specific ascx page. I found the following pages that have some info but I'm unsure how to implement this in my situation because they all deal with the RadAjaxPanel and not the RadAjaxManager:
http://www.telerik.com/help/aspnet-ajax/ajax-download.html
http://www.telerik.com/help/aspnet-ajax/ajax-exclude.html
http://www.telerik.com/support/kb/aspnet-ajax/ajax/how-to-disable-ajax-for-specific-items-of-an-ajax-ified-navigational-control.aspx

I appreciate any advice you can offer.
Thanks,
G

1 Answer, 1 is accepted

Sort by
0
20Below
Top achievements
Rank 1
answered on 18 Apr 2011, 04:08 PM
Problem solved, solution found on this page:
http://mono.telerik.com/Ajax/Examples/Manager/PartialPostBacks/DefaultCS.aspx
The page is a demo but you guys should reference this or put an example in one of those pages I mentioned earlier so the solution is more visible. It would help Telerik noobies like me. :)

string ajaxManagerClientID = RadAjaxManager.GetCurrent(this.Page).ClientID;
btnReport.OnClientClick = String.Format(@"{0}.__doPostBack(""{1}"",""{2}"");return false;", ajaxManagerClientID, btnReport.UniqueID, btnReport.CommandArgument);
Tags
General Discussions
Asked by
20Below
Top achievements
Rank 1
Answers by
20Below
Top achievements
Rank 1
Share this question
or