[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


button click for a control gets processed on each postback

Posted on 2011-10-06
Medium Priority
Last Modified: 2012-08-14
I have a user control with a button on it.

The user control is on a web form.

When I click on the button for the user control, the click event fires.

But then, if I simply refresh the browser page (without clicking that button) the event for the button fires (as if I had clicked it).

How can I prevent this behavior?
Question by:Tom Knowlton
LVL 12

Accepted Solution

Kaushal Arora earned 1000 total points
ID: 36925975
You cannot prevent that event. but you can check on that event like if the values submitted on the button click is already present in the DB or not.

Hope it helps.
LVL 15

Assisted Solution

Navneet earned 1000 total points
ID: 36926021

That  the way it is. When you load the page again / refresh it, the entire page cycle gets fired again.You can at the most Popup the alert to the user prompting whether he want's to really refresh again
with OK CANCEL option.


Author Closing Comment

by:Tom Knowlton
ID: 36926064

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month20 days, 3 hours left to enroll

873 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