Popup Window on Button Push

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
 
K

Kathy Burke

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
 
N

Natty Gur

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
 
K

Kathy Burke

Nat, where does this go exactly?

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

Thanks,

Kathy
 
N

Natty Gur

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
 

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,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top