?
Solved

control autopostback

Posted on 2004-11-17
13
Medium Priority
?
416 Views
Last Modified: 2008-02-01
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...
0
Comment
Question by:sony1464
  • 5
  • 5
  • 2
12 Comments
 
LVL 28

Expert Comment

by:iboutchkine
ID: 12606081
On a clcik event try to register java script
"javascript:this.style.cursor='pointer';" and
"javascript:this.style.cursor='normal';"
0
 
LVL 3

Author Comment

by:sony1464
ID: 12606190
can u show me a sample code please
0
 
LVL 28

Expert Comment

by:iboutchkine
ID: 12606234
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
0
Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

 
LVL 3

Author Comment

by:sony1464
ID: 12606849
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.
0
 
LVL 28

Expert Comment

by:iboutchkine
ID: 12606913
put it in the control click event or anywhere you need
0
 
LVL 3

Author Comment

by:sony1464
ID: 12607692
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
0
 
LVL 28

Expert Comment

by:iboutchkine
ID: 12608108
I am not really  sure. But you are adding attribute. On a second click you have to remove attribute first
0
 
LVL 3

Author Comment

by:sony1464
ID: 12608803
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
0
 
LVL 28

Expert Comment

by:iboutchkine
ID: 12608857
I don't know your code, but maybe you can disable testbox during this period?
0
 
LVL 26

Accepted Solution

by:
Rejojohny earned 300 total points
ID: 12611928
u could have a check in the javascript to check whether the button is been clicked for the second time .. this can be done by checking the cursor ... then give approriate message ... like this ...

fuction waitcursor()
{
if (document.body.style.cursor !='pointer')
   document.body.style.cursor='pointer'
else
   alert('Processing. Please wait ...');
}
0
 
LVL 3

Author Comment

by:sony1464
ID: 12615516
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.
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 12615639
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;
}
}
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question