Click here to Skip to main content
Click here to Skip to main content

Tagged as

Prevent firing button click event when refreshing the page

, 10 Oct 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
Prevent firing button click event when refreshing the page
During development we can come across this issue. I found many solutions about this issue. However i found an easy solution for this.
 
I add the following line of code in my button click event and it resolves the problem.
 
Page.Response.Redirect(Page.Request.Url.AbsoluteUri);
 
It prevents firing the button click event when we refresh the page.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Sandesh M Patil
Software Developer (Senior)
India India
Sandesh has a 6 years of total professional experience in a software development. He first handled the computer in his school days when he was in 7th std working on Lotus. In summer vacation, the school authorities allowed him and other students to use the computers for practicing Lotus and playing different games Smile | :) .
 
He has done computer engineering. Currently he is working in Net 4.0 framework. Even though he is using .Net 4.0 framework for development but still he has not got a chance to work with newer technologies like MVC, WCF etc. However he always try to learn these technologies from his end and eagerly waiting for a chance to work with the newer technologies like MVC, WCF and Silverlight etc.

Comments and Discussions

 
QuestionThank you PinmemberDilan Fdo26-May-14 23:06 
AnswerRe: Thank you Pinmember$andesh M Patil27-May-14 23:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.141030.1 | Last Updated 10 Oct 2011
Article Copyright 2011 by Sandesh M Patil
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid