views:

649

answers:

3

Hi,

I have a problem with my AJAX and ASP.NET 3.5 :( Problem is really weird, as I'm using the same thing on different page and it works fine in there, but on this specific page, this is not working.

Here's what I have:

    <asp:UpdatePanel ID="upMain" runat="server" UpdateMode="Conditional" Visible="true" RenderMode="Inline">
                <ContentTemplate>
<asp:DropDownList ID="ddlNewService_PortTelco" runat="server" Width="250" CssClass="dropdown" AutoPostBack="true" OnSelectedIndexChanged="Provision_PortedTelcoChanged"></asp:DropDownList>
</ContentTemplate>
</asp:UpdatePanel>

On the way before the DropDown there is one DIV (html one), and then few asp:Panels. I do not understand why this is causing a FULL POST BACK ?!

Any ideas ? Thanks

A: 

How do you bind your DropDown? The code that you have provided works on my side with static items. Perhaps it is something in the other controls that is causing the problem.

I have noticed that your UpdatePanel has its UpdateMode property set to conditional, however you haven't defined any triggers.You can try to explicitly set that the update panel should perform async postback when your dropdown triggers its selectedIndexChanged event. You can use something like the following markup:

<asp:UpdatePanel ID="upMain" runat="server" UpdateMode="Conditional" Visible="true"
    RenderMode="Inline">
    <ContentTemplate>
        <asp:DropDownList ID="ddlNewService_PortTelco" runat="server" Width="250" 
            AutoPostBack="true" OnSelectedIndexChanged="Provision_PortedTelcoChanged">
        </asp:DropDownList>
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="ddlNewService_PortTelco" EventName="SelectedIndexChanged" />
    </Triggers>
</asp:UpdatePanel>
Genady Sergeev
Hi! Thanks for a reply. I tried adding AsyncPostBack trigger as well, but it didn't help. It's not in my example, as for what I know if an OBJECT causing an Update is INSIDE Update Panel then You don't need to specify the Trigger. Triggers are required for Objects OUTSIDE the UpdatePanel.I tried changing UpdateMode to Always, but that didn't help as well.I'm already playing with the code, and I noticed that when I created OTHER UpdatePanel just after this one, and I added identical code inside it worked well :/ So there must be something inside this UpdatePanel which makes it work wrong.
A: 

Excuse my lack of programing skills :| It all worked all the time, but because one of the actions page "looked" like it's POST BACKED, when it wasn't. What a shame!!!

Sorry for waisting Your time!

A: 

You have your drop down list with an AutoPostBack set to true. That's why you have it post back instead of AsyncPostBack, if that is what you wanted.

Remove the AutoPostBack=true from the dropdownlist and set an Async trigger for your UpdatePanel set to the dropdownlist and its eventname="SelectedIndexChanged"

HomerJones