Prevent PostBack

  • Thread starter Thread starter Jonathan Wood
  • Start date Start date
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
 
onclientclick="ShowHelp('help_rent.aspx');return false;" />

-- bruce (sqlwork.com);
 
You can have ShowHelp() return false, as well.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
 
And I assume you mean to change the call to onclientclick="javascript:return
ShowHelp('help_desc.aspx')"

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

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

*************************************************
| Think outside the box!
|
*************************************************
 
Back
Top