I have come across quite a wired problem right now.
I am using ASP.NET in Visual Studio 2010. Now I have a huge processing plus network integration to do when the user clicks a button. Point saying is that it takes a lot of time (about 1-1.5 minutes) for the response. Till then, i have to tell the user to be patient and do not refresh the page. I tried this as the first line of buttons :
label.visible=true;//label is initially set to invisible and has text that says user to be patient.
NO LUCK!!!
Next I also tried
Response.Write(“alert(‘Please be patient.’)”);
NO LUCK!!!
It is not that these statements are not executed. They are! But there are actually done after the processing time is over. i.e. user is told to be patient after the operation is done!
I know there is some concept called autopostback, but i can’t find a method that allows autopostback of a label or an instruction. Can anyone save my day???
You probably need to look at some javascript on the client, that is run at the point the user initiates this process. If (for example) you are initiating the process via a normal asp:Button then put in something like…
I know nothing about jquery, but I’m led to believe that would give you much better access to the label object within the DOM.
You might also want to disable the btnInitiate button to stop them repeat clicking. For this you’d need to investigate the UseSubmitBehavior=”false” property
(Also, you misunderstand the “autopostback” property. It means that the control – when changed / clicked / etc – will automatically post back the form to the server. It is nothing to do with the response back from the server.)