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

DropDownList Causing Full Postback Inside RadAjaxPanel

6 Answers 175 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Avs8686
Top achievements
Rank 1
Avs8686 asked on 17 Jul 2013, 02:41 PM
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?

6 Answers, 1 is accepted

Sort by
0
Avs8686
Top achievements
Rank 1
answered on 19 Jul 2013, 08:05 PM
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.
0
Antonio Stoilkov
Telerik team
answered on 22 Jul 2013, 08:39 AM
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.
0
Avs8686
Top achievements
Rank 1
answered on 22 Jul 2013, 11:54 AM
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?
0
Avs8686
Top achievements
Rank 1
answered on 22 Jul 2013, 12:07 PM
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?

0
Avs8686
Top achievements
Rank 1
answered on 22 Jul 2013, 03:51 PM
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?
0
Antonio Stoilkov
Telerik team
answered on 25 Jul 2013, 05:48 AM
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.
Tags
Ajax
Asked by
Avs8686
Top achievements
Rank 1
Answers by
Avs8686
Top achievements
Rank 1
Antonio Stoilkov
Telerik team
Share this question
or