prevent ImageButton to postback

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to prevent an ImageButton to make a postback, since I added its
action in Javascript. But I don't want to remove runat="server", since
without this I cannot attach the JavaScript (build dynamically in code
behind) to the button.
Is there a way to do this ?
 
Set its PostbackUrl property to "javascript:void(0);"

message I would like to prevent an ImageButton to make a postback, since I added its
action in Javascript. But I don't want to remove runat="server", since
without this I cannot attach the JavaScript (build dynamically in code
behind) to the button.
Is there a way to do this ?
 
Another way is at the end of your javascript add: return false;

like this: your javascript ends here; return false;

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
Back
Top