Reputation: 3
How can i show a gif after buttonclick and hide it when a function is finished?
<ISWebDesktop:WebButton ID="Button1" runat="server" Height="20px" Text="Ablehnen" meta:resourcekey="btnAblehnen" Width="75px"
AutoPostback="True" PostBackMode="FullPostBack">
</ISWebDesktop:WebButton>
<asp:Image ID="emailLoader2" runat="server" ImageUrl="../../images/ajax-loader2.gif" Visible="false"/>
Codebehind:
Protected Sub Button3_Clicked(ByVal sender As Object, ByVal e As ISNet.WebUI.WebDesktop.WebButtonClickedEventArgs) Handles Button3.Clicked
//show the gif
Dim msg As String = "OK"
Dim spezial As Integer = 0
.....
//hides the gif
END SUB
Upvotes: 0
Views: 822
Reputation: 809
You should use jquery to get data asynchronously. Assuming your current page is index.html
, which contains:
<p style="display: none;"><img src="loading.gif" />Loading...</p>
It's a hidden loading bar. Then, use jquery .post
or .get
method to get data from your another page like:
$.get("test.asp", function () {
$("img").delay(500).hide();
$("p").text("Loading Complete.");
});
So here's the final calling order:
index.html
.get()
function to execute test.asp
test.asp
execution finished, hide the loading gif, change the loading text.Upvotes: 1