Link to home
Start Free TrialLog in
Avatar of sony1464
sony1464

asked on

control autopostback

I have developed an application using asp.net and vb.net....I have set few controls on a page to Autopostback=true. The page refreshes every time they click these controls. But it allows the user to enter fields in other controls while it is refreshing. I would to somehow make sure that user is not able to enter data in any of the fields while it is refreshing. changing cursor would be one option...but i don't know how to do this in web app...
Avatar of iboutchkine
iboutchkine

On a clcik event try to register java script
"javascript:this.style.cursor='pointer';" and
"javascript:this.style.cursor='normal';"
Avatar of sony1464

ASKER

can u show me a sample code please
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
 Me.RegisterStartupScript("Error", _
  "<script language='javascript'>this.style.cursor='pointer';</script>")

'do something

End Sub
The button1_click would still be executed only after the screen refreshes right....I would like the procedure to be called imm after the control is clicked.
put it in the control click event or anywhere you need
in page_ load i have

Me.chkcity.attributes.add("onClick","javascript:waitcursor();")

and in the client side i havea function

fuction waitcursor()
{

document.body.style.cursor='pointer'
}



The first time i click on the check box the cursor changes and it is good...the second time i click on the check box again....it crashes.....what is the reason....I have IE 6.0
I am not really  sure. But you are adding attribute. On a second click you have to remove attribute first
I tried attributes.remove before adding.....it still crashes after we click a couple of times.....is there any other way other than changing cursor....i just do not want user to key in during the screen refresh.....thanks for the feedback so far
I don't know your code, but maybe you can disable testbox during this period?
ASKER CERTIFIED SOLUTION
Avatar of Rejojohny
Rejojohny
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The application crashes when i try to click the same button after the page has been loaded after the button click. So it is not a problem where the user clicked the same button while it was refreshing.
application crashes? do u get an error .. not sure .. could be case because the same code gets run again and again .. do try this ...
fuction waitcursor()
{
if (document.body.style.cursor !='pointer')
   document.body.style.cursor='pointer'
else
{
   alert('Processing. Please wait ...');
   window.event.returnvalue = false;
}
}