about onclientclick and postback

A

Alex D.

Hi.
I need to use a linkbutton to open a new window (it has to be a linkbutton
to match the look and feel of a link). In order to do that I use the
OnClientClick property and insert some javascript into it. It works fine but
I dont want the button to cause a postback since all I need is a client
javascript to open a new window.
Does any body knows how to disable the postback behavior?

Thanks,
alex.
 
A

Alex D.

I figured out already...instead of a linkbutton I used a server hyperlink
control with a NavigateURL property set to something like: javascript:; in
order for the link to be underline and the cursor to change to the hand one.
also added the real javascript to the attributes property. It works ok and
doesnt cause a postback.
 
S

S. Justin Gengo

Alex,

Glad you found a solution. Another way to do this would be to add "return
false;" as the last part of your javascript.


--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
A

Alex D.

Thanks Justin.

S. Justin Gengo said:
Alex,

Glad you found a solution. Another way to do this would be to add "return
false;" as the last part of your javascript.


--
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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top