tags:

views:

1523

answers:

4

I have a asp.net button which is runat server. there is a function handle the postback of button onclick.

How can I display a "loading ..." word in the page before going the server procedure ...?

+2  A: 

Look at OnClientClick, you can add a call to a js function, or inline JS there.

Or you can wire into the button with JQuery and display a modal dialog with an async callback.

blu
+6  A: 

Hook up OnClientClick to some javascript function that returns true or false. The postback occurs if it returns true else it is canceled.

  <asp:Button id="MyButton" runat="Server" Text="Close" 
                       OnClientClick="return  PromptClose();"/>


  <script type="text/javascript">
   function PromptClose(){
       return prompt("Do you really want to close this window?");
   }
  </script>
TheVillageIdiot
+1  A: 
Dan Herbert
A: 

I need the response before the postback(server code) ...

Jay