Pages

Monday, December 29, 2008

Avoid Postback

I had to show an alert on a button click,but when ever i "OK" it always postsback.

To avoid such a thing simply we can use HTML Control.

have the following code in code-behind window.

Button.Attributes.Add("onclick","alert('Are You Sure ??');return false;");

This will prevent postback....

No comments: