Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVoid Postback on OnClick Event

I have a Javascript function

show()
{
alert("hello");
}

which runs on ASP Button OnClick Event.

When I click the button of alert message box showing "hello", postback occurs. Is there any way I cant prevent this postback?

like image 246
Mishigen Avatar asked May 13 '26 07:05

Mishigen


1 Answers

Try:

return false;
like image 194
rodrigoap Avatar answered May 15 '26 20:05

rodrigoap