Prevent PostBack

J

Jonathan Wood

I have an image button on my page that runs some javascript:

<asp:ImageButton runat="server" id="ImageButton3"
ImageUrl="Graphics/Help.png" AlternateText="Help"
onclientclick="javascript:ShowHelp('help_rent.aspx')" />

ShowHelp() is a function that I create that calls window.open().

It works okay--it pops up a separate help window with content from another
page--but it also refreshes the current page, which I want to prevent.

How do I stop the default behavior?

Jonathan
 
B

bruce barker

onclientclick="ShowHelp('help_rent.aspx');return false;" />

-- bruce (sqlwork.com);
 
J

Jonathan Wood

And I assume you mean to change the call to onclientclick="javascript:return
ShowHelp('help_desc.aspx')"

Thanks.
 
C

Cowboy \(Gregory A. Beamer\)

Pretty much anything that sends back a false will interrupt the postback.
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top