0

Using VS 2010 here. Basically some of my linkbuttons kick off a long database query, how can I automagically display a spinner when the page is waiting for a postback? Mind you, this isn't an ajax postback, but a normal postback after clicking a server linkbutton.

Thanks

bulltorious
  • 7,919
  • 4
  • 48
  • 75

2 Answers2

1

Why dont you use update panel?

using update panel you can easily set the loading image until your call comes back.

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:UpdateProgress ID="UpdateProgress11" runat="server" DisplayAfter="0" AssociatedUpdatePanelID="UpdatePanel1">
            <ProgressTemplate>
               <asp:Image ID="Image11" runat="server" ImageUrl="~/Images/etls/preloader.gif" />
            </ProgressTemplate>
        </asp:UpdateProgress>
        <table border="0">
            <tr>
                <td>
                   Your content here, with the button.
                </td>
            </tr>
        </table>
    </ContentTemplate>
</asp:UpdatePanel>
Gavin Miller
  • 42,055
  • 20
  • 117
  • 184
Zain Shaikh
  • 5,923
  • 6
  • 38
  • 65
0

I have to say 2xUpdate Panel solution. This solution is quickly implimented and effective.

Joe Johnston
  • 2,490
  • 1
  • 28
  • 51