views:

46

answers:

1

Hello all,

On my website I have it setup where when someone clicks on one of my items, a modal JQuery dialog box pops up. Works great (thanks to Stackoverflow help)! So now I dynamically create linkbuttons and imagebuttons inside the dialog, depending on what was clicked on. When I created said buttons (all server side), this is what I told them to do:

inserttext2.OnClientClick = "window.open('" + vendorurl + "')"
vendorpic.OnClientClick = "window.open('" + vendorurl + "')"

The variable vendorurl is figured out earlier, but it is the URL that will open up in a new tab/window when someone clicks on the appropriate control. When someone does click on it, it does open the new tab like its supposed to! Hooray. But! When I go back to my original tab that had the JQuery dialog open, it is now gone! How would I go about making sure the Dialog doesn't close unless someone actually clicks the little X thingy to close it?

I assume since I used the OnClientClick, then all the action would happen user-side via javascript, and not create a postback (or whatever is happening).

EDIT: In case you need to see it, the problem can be duplicated by going here: http://www.mobiuspc.com Then click on the processor tab, then click on the 5th item down which should be AMDZ940XCGIBOX. This is one I use for testing, as once you click on (just once, and don't drag it), then in the resulting dialog window it has multiple links available to click on. Not all of the items have the links, hence why I standardized to this one item for consistent tests.

+3  A: 

Try this for the OnClientClick

"window.open('" + vendorurl + "'); return false;"
schdr
Works perfect! Thank you so much! To better my understanding, I assume return false means that once the event fires (window.open in this case), then it doesn't bother telling the server anything happened, and therefore no postback! brilliant!
Bill Sambrone