Monday, June 29, 2009

Preventing Auto Postbacks

Ever felt like ASP.NET web pages doing postback by themselves? Or better, someone click on Enter and instead clicking on the default button on the webpage, the page just "refreshing" itself.

Well, try
this great code snippets in your body tag:
BODY onkeydown = "return (event.keyCode!=13)"
This code will prevent auto postback of your page when user clicks on Enter. More options are available in the mentioned webpage.

Keep Performing!


No comments:

Post a Comment