javascript - ASP.Net OnClick Subs not operating how I want -


i using onclick handlers process button clicks query sql. problem is, these queries take 10 - 30 seconds before return. disabled buttons prevent click-stacking during time, have little loading gif appear while sub finishes doing thing.

so go this: click -> button disabled -> loading gif appears -> onclick sub completes -> loading gif disappears -> more ajax happens on same page

here button looks like

<asp:button id="buttonone" runat="server" visible="false" text="next" onclientclick="this.disabled=true;" usesubmitbehavior="false" onclick="username_click"/> 

and page-behind

sub username_click(byval sender object, byval e eventargs)     showwidget(true)     'this part takes few seconds     if usernameisvalid(textfield.text)     buttontwo.visible = true, labeltwo.visible = true,   buttonone.visible = false, labelone.visible = false      end if     showwidget(false)      end sub 

the result getting .gif doesn't load (it registers showwidget(flase)).

how can tie loading image button click, make loading image go away after subroutine of click action finishes?

thanks!

this approach not work. need use html button , on botton click call server-side method using ajax, wnd show animation/gif using jquery/bootstrap.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -