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

Composite control alternating full/partial postback

3 Answers 91 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
KK60
Top achievements
Rank 1
KK60 asked on 12 Nov 2013, 04:04 AM

I've built an ASP.NET composite control which includes several asp label controls, two textbox controls and a button control.  The composite control functions perfectly - without having any of the above controls ajaxified - in a parent page that already has a RadAjaxManager.

Now I want to ajaxify the composite control. I followed the various examples and sample code, but no matter which way I arrange the code, when I ajaxify the the button, two text boxes and a label in the composite control and click the button, I always get alternating full postback and asynchronous (partial) postback. (So I get the effect I want every other button click.)

// in CreateChildControls I added:

            RadAjaxManager objTelerikAjaxManager = RadAjaxManager.GetCurrent(Page);
            if (objTelerikAjaxManager == null)
            {
                objTelerikAjaxManager = new RadAjaxManager();
                objTelerikAjaxManager.ID = "RadAjaxManager1";
                Controls.Add(objTelerikAjaxManager);
            }
            .
            .

            // create controls and add to collection, then:
            .
            .

            objTelerikAjaxManager.AjaxSettings.AddAjaxSetting(objFELoginControlButtonLogin, objFELoginControlButtonLogin);
            objTelerikAjaxManager.AjaxSettings.AddAjaxSetting(objFELoginControlButtonLogin, objFELoginControlLabelMessage);
            objTelerikAjaxManager.AjaxSettings.AddAjaxSetting(objFELoginControlButtonLogin, objFELoginControlTextBoxUser);
            objTelerikAjaxManager.AjaxSettings.AddAjaxSetting(objFELoginControlButtonLogin, objFELoginControlTextBoxAppID);

What am I missing and what should I check?  Is there an alternative recommendation for placing the above code blocks?

Thanks

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 14 Nov 2013, 03:16 PM
Hi Carmen,

Could you please ensure that you have a RadScriptManager or a  asp ScriptManager control on the very top of the content page before the RadAjaxManager declaration?

Regards,
Maria Ilieva
Telerik
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 the blog feed now.
0
KK60
Top achievements
Rank 1
answered on 14 Nov 2013, 04:36 PM
All of the aspx pages that will use the composite control have the items you mentioned in the <body> and are laid out like this:

<body onload="maximizeWindow();">

  <form id="formAdminLogin" runat="server">

  <telerik:RadScriptManager ID="RadScriptManager1" runat="server">

    <Scripts>

      <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />

    </Scripts>

  </telerik:RadScriptManager>

  <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Web20" ></telerik:RadSkinManager>

  <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Web20"/>

  <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"></telerik:RadCodeBlock>

  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager>

  <cc1:OurControl ID="OurControl1" runat="server" ParentName="Administration" Version="Not Set" Message=""></cc1:OurControl>

  </form>

</body>

0
Maria Ilieva
Telerik team
answered on 19 Nov 2013, 12:39 PM
Hello Frank,

Could I kindly ask you to open a regular support ticket and send us sample runnable application which demonstrates the problematic behavior? The approach you are suing looks correct to me , so we will need to debug your application on our end and isolate the root cause of the issue.

Regards,
Maria Ilieva
Telerik
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 the blog feed now.
Tags
Ajax
Asked by
KK60
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
KK60
Top achievements
Rank 1
Share this question
or