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

master page and content page

3 Answers 201 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
appdev
Top achievements
Rank 1
appdev asked on 20 Apr 2012, 04:33 AM
will the code below work? but if it does, then every time i add new content page and want to
have a post back on a control, i have to add that into master page? can't i just have the
manager in content page?


below code is in master.master
<
telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnDecrease">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="TextBox1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

below code is in default.aspx
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:Button ID="btnDecrease" runat="server" Text="Increase" OnClick="btnDecrease_Click" />
    <asp:textbox ID="TextBox1" runat="server" Text="0"></asp:Label>
</asp:Content>

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 Apr 2012, 05:21 AM
Hello Duy,

RadAjaxManager can handle only cases when there controls to ajaxify are beneath in the manager control hierarchy. A better approach is placing the RadAjaxManager in MasterPage and adding proxy controls in content pages.
aspx:
<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
 <AjaxSettings>
   <telerik:AjaxSetting AjaxControlID="btnDecrease">
    <UpdatedControls>
      <telerik:AjaxUpdatedControl ControlID="TextBox1" />
    </UpdatedControls>
   </telerik:AjaxSetting>
 </AjaxSettings>
</telerik:RadAjaxManagerProxy>

Thanks,
Shinu.
0
appdev
Top achievements
Rank 1
answered on 23 Apr 2012, 10:06 PM
but then in page load event, what do put instead of RadAjaxManager1.IsInAsyncPostBack.


i usually do that but now the radajaxmanager1 is in master page and i can't really use that, what do i use for a asyncpostback in content page?
0
Maria Ilieva
Telerik team
answered on 26 Apr 2012, 12:31 PM
Hi Duy,

You could get reference to the main manager on the master page and still proceed with the needed check like this:

ContentPage:
RadAjaxManager.GetCurrent(Page).IsInAsyncPostBack

Hope this helps.

Greetings,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Ajax
Asked by
appdev
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
appdev
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or