prevent ImageButton to postback

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 ?
 
S

Siva M

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 ?
 
S

S. Justin Gengo

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top