Problem when displaying the GIF loader via Ajax

advertisements

I have a below section which is implemented to display loader gif associated to the update panel

  <asp:ScriptManager runat="server"></asp:ScriptManager>
 <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="updPnlPromotion">
    <ProgressTemplate>
                <img alt="" src="Image/Ajaxloader.gif" />
    </ProgressTemplate>
 </asp:UpdateProgress>

This is the update panel which contains the dropdown which is a data bound control binded on the radio button checked changed event, but rather than partial postback and the display of loader gif, the entire page posts back.

 <asp:UpdatePanel ID="updPnlPromotion"  runat="server" UpdateMode="Always">
              <ContentTemplate>
                <td align="left" style="width: 20%;background-color:#CDCD9C">
                    <asp:radiobutton ID="rdbPromotion" runat="server" Text="New Promotion" AutoPostBack="true" GroupName="TacPlan" OnCheckedChanged="rdbPromotion_OnCheckedChanged"  style="font-weight:bold" />
                </td>
                <td align="left" style="width:30%; vertical-align:middle; background-color:#EBEBEB; text-align:center">
                    <asp:DropDownList runat="server" ID="ddlPromotion" Width="95%"></asp:DropDownList>
                </td>
                <td>
                    <asp:Label Text="*" ForeColor="Red" Visible="false" runat="server" ID="lblPromoPlanMandatory"></asp:Label>
                </td>
               </ContentTemplate>
               <Triggers>
                <asp:AsyncPostBackTrigger ControlID="rdbPromotion" EventName="CheckedChanged" />
               </Triggers>
          </asp:UpdatePanel>


I don't believe there's an issue with the code you've posted. I created a new ASPX page and copied your code into it. It works as expected (I added a counter to monitor load events):

Here's the code behind I used for testing this:

Public Sub rdbPromotion_OnCheckedChanged(sender As Object, e As EventArgs) Handles rdbPromotion.CheckedChanged
    System.Threading.Thread.Sleep(2000)
End Sub

Private Sub Default5_Load(sender As Object, e As EventArgs) Handles Me.Load
    Me.counter.Text = Integer.Parse(Me.counter.Text) + 1
End Sub

Seems like a longshot, but maybe the browser you're testing with doesn't support partial rendering, or ASP.NET doesn't think that it does?:

http://ajax.asp.net/ajax/documentation/live/mref/P_System_Web_UI_ScriptManager_EnablePartialRendering.aspx