Equivalent to ".Show" in VS.NET webForm

  • Thread starter Thread starter Mike
  • Start date Start date
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?
 
Hi,

In the click event of your webform button do this:

Response.Redirect("NewWebPage.aspx")

Good luck! Ken.
 
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
 
Back
Top