I want to call the loading screen while the page load in vb.net.
I have my Loading screen design inside the Loading.html
I try to use this way to call the loading screen:
Public Shared Sub ShowLoading(page As Page)
Dim script As String = "<script>" &
"function showLoading() {" &
"$('body').append('<div id=""loading""></div>');" &
"$('#loading').load('/Module/Common/Loading.html');" &
"}" &
"</script>"
ScriptManager.RegisterStartupScript(page, GetType(Page), "ShowLoadingScript", script, False)
End Sub
vb.net code behind:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
ShowLoading(Me)
End Sub
with this way it cannot auto call while page load, it need me to put onclientclick=”showLoading() in the button just come out the loading screen.
Does anyone can help me thanks in advance