Popup Window on Button Push

  • Thread starter Thread starter Temp
  • Start date Start date
T

Temp

Can anyone tell me how I can open a new browser window when a button is
pressed?

I tried adding an <a href=...> encapsulating the button, but it didnt work.

Any suggestions?

--
_____________________________
Ron Rodenberg
Lead Software Engineer
Razorvision Technology, Inc.
(214) 207-1688
 
Try adding this in your page init:

btnName.Attributes.Add("onclick", "pop_window();return false;")

and put your script for it in the html <head>, for example:

<script language="javascript">
function pop_window()
{
var confirmWin = null;
confirmWin = window.open('Scanned.aspx', 'WindowName',
'width=300,height=400,left=200,top=200,toolbar=no,resizable=no,menubar=n
o');
}
</script>

hope this helps.

Kathy
 
in adition to Kathys replay,

If you'r using ASP:Button add :
window.event.returnValue = false;
window.event.cancelBubble = true;

to prevent postback.

Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
 
Nat, where does this go exactly?

window.event.returnValue = false;
window.event.cancelBubble = true;

Thanks,

Kathy
 
Kathy Hi,

usually in pop_window function. but i didnt see the "return false;"
sorry :-( .

Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
 
Back
Top