DropDownList Causing Full Postback Inside RadAjaxPanel

7 posts, 0 answers
  1. Avs8686
    Avs8686 avatar
    12 posts
    Member since:
    Feb 2013

    Posted 17 Jul 2013 Link to this post

    Good morning,

    I've done my fair share of searching for the past hour and haven't been able to solve what seems to be a simple mind boggling issue.

    Please find below the following simple front end code.

    <Rad:RadAjaxPanel ID="RadAjaxPanel1" EnableAJAX="true"  runat="server">
                <asp:DropDownList ID="ddlFirstDDL" AutoPostBack="true" OnSelectedIndexChanged="ddlFirstDDL_SelectedIndexChanged" runat="server" />
           
        </Rad:RadAjaxPanel>

    Pretty basic, I know.  When changing the index of the DDL, the page is performing a full postback.  Swapping a different control in, like a CheckBoxList, works as expected with a partial postback.

    What am I missing?
  2. Avs8686
    Avs8686 avatar
    12 posts
    Member since:
    Feb 2013

    Posted 19 Jul 2013 Link to this post

    Still trying to figure this one out, but I was able to isolate the issue, which leads to even more questions.

    The page I was trying to run that code on has a MasterPage associated with it. Removing that link with the masterpage "fixed" the issue with it doing a full postback on SelectedIndexChange; however, even if I have a basically empty MasterPage with just a form tag and a RadScriptManager on it, the issue returns so that rules out anything else I had on the MasterPage file causing the issue.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Antonio Stoilkov
    Admin
    Antonio Stoilkov avatar
    530 posts

    Posted 22 Jul 2013 Link to this post

    Hi Andrew,

    You could take a look if there are any JavaScript errors thrown on the page because in order for a successful ajax request to be send there should be no errors on the page.

    I have tried to replicate the described issue but to no avail. I have assembled two sample pages with MasterPage and RadAjaxPanel and DropDownList in the content page working as expected on my side. Additionally, I have created a video showing the behavior working on my side. You could take a look at the provided pages and observe if there are any differences at your end.

    Regards,
    Antonio Stoilkov
    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.
  5. Avs8686
    Avs8686 avatar
    12 posts
    Member since:
    Feb 2013

    Posted 22 Jul 2013 Link to this post

    Hi Antonio,

    Thank you for taking the time to put that together for me.  I added those files to my application and ran it. It's performing a full postback in my application so there must be a setting or something that is causing that. 

    In addition, I took away the MasterPageFile link, added the RadScriptManager and Form tag to the page and it worked as expected.

    Do you have any suggestions on what setting in web.config or elsewhere that could be creating this?
  6. Avs8686
    Avs8686 avatar
    12 posts
    Member since:
    Feb 2013

    Posted 22 Jul 2013 Link to this post

    Antonio,

    In Visual Studio 2012, I decided to try creating a brand new application and see if that made a difference.  I have the telerik tools installed on this machine so I created a new RadControlsWebApp.  In this, your simple example is working as it should.

    In the application I am working on now, it was never started as a "RadControlsWebApp", just a regular ASP.Net Web Forms Application.  Could I be missing something, a reference, a setting in web.config, etc that I need to add?

  7. Avs8686
    Avs8686 avatar
    12 posts
    Member since:
    Feb 2013

    Posted 22 Jul 2013 Link to this post

    Alright, I've been at this for several more hours and I was able to single out the setting in my web.config file that was causing DropDownLists inside RadAjaxPanels to do full postbacks.

    It turns out setting the ClientIDMode to static inside <pages> in web.config is the culprit.

    <pages clientIDMode="Static"> <---- Causing full postback

    <pages> <--- Removing clientIDMode="Static" fixed it.

    Is this a known issue?
  8. Antonio Stoilkov
    Admin
    Antonio Stoilkov avatar
    530 posts

    Posted 25 Jul 2013 Link to this post

    Hello Andrew,

    All Telerik RadControls do not support ClientIDMode="Static". The reason for that is the advanced client-side functionalities that the controls provide. When ClientIDMode is set to Static all controls does not respect their INamingContainer's to determine their ClientID and a lot of controls end up with the same html id which leads to invalid html. In your case the RadAjaxPanel expects to have id with different naming convention and its client-side code fails.

    Regards,
    Antonio Stoilkov
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017