Equivalent to ".Show" in VS.NET webForm

M

Mike

I am trying to call one webform from the click event of a button on
another webform. In VB6 windows applications, this is a simple
Form.Show, but I can't figure out the syntax to call Webforms. Can
anyone help with some sample code?
 
K

Ken Dopierala Jr.

Hi,

In the click event of your webform button do this:

Response.Redirect("NewWebPage.aspx")

Good luck! Ken.
 
J

John Timney \(Microsoft MVP\)

You want window.open

<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=500,height=500');}<"
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,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top