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,769
  • 4
  • 49
  • 78

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
  • 43,168
  • 21
  • 122
  • 188
Zain Shaikh
  • 6,013
  • 6
  • 41
  • 66
0

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

Joe Johnston
  • 2,794
  • 2
  • 31
  • 54