How to open a new browser window in ASP.net?

  • Thread starter Miguel Dias Moura
  • Start date
M

Miguel Dias Moura

Hello,

i have an ASP.net page with a button. When the button is clicked i want to
open a new Browser window (400x200px) having only the title bar and nothing
else.This browser window would load newpage.aspx in it.

I would also like to know how to create a button to insert in newpage.aspx
and that would close that same window.

I have no idea of how to do this and until now i didn't find some
information that might help me out.

I am working in ASP.net / VB

Thank You,
Miguel
 
J

John Timney \(Microsoft MVP\)

This might get you started

<html>
<head>
<script language="VB" runat="server">

Sub Page_Load( sender as Object,e as EventArgs)

'Form the script that is to be registered at client side.
Dim scriptString as String = "<script language=JavaScript> function
DoClick() {"
ScriptString +=
"window.open('http://www.mvps.org','MyWindow','width=400,height=200');}<"
scriptString += "/"
scriptString += "script>"

If(Not IsClientScriptBlockRegistered("clientScript"))
RegisterClientScriptBlock("clientScript", scriptString)
End If
End Sub
</script>
</head>
<body topmargin="20" leftmargin="10">
<form id="myForm" runat="server">

<INPUT id="launchButton" onclick="DoClick();" type="button"
value="Submit" name="myButton" runat="server">


</form>
</body>
</html>

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
 

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,754
Messages
2,569,516
Members
44,975
Latest member
MDACVIngedients

Latest Threads

Top