Equivalent to ".Show" in VS.NET webForm

Discussion in 'ASP .Net' started by Mike, Nov 10, 2004.

  1. Mike

    Mike Guest

    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?
     
    Mike, Nov 10, 2004
    #1
    1. Advertising

  2. Hi,

    In the click event of your webform button do this:

    Response.Redirect("NewWebPage.aspx")

    Good luck! Ken.

    --
    Ken Dopierala Jr.
    For great ASP.Net web hosting try:
    http://www.webhost4life.com/default.asp?refid=Spinlight
    If you sign up under me and need help, email me.

    "Mike" <> wrote in message
    news:...
    > 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?
     
    Ken Dopierala Jr., Nov 10, 2004
    #2
    1. Advertising

  3. 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



    "Mike" <> wrote in message
    news:...
    > 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?
     
    John Timney \(Microsoft MVP\), Nov 10, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. titof
    Replies:
    0
    Views:
    580
    titof
    Jul 24, 2003
  2. timmso
    Replies:
    1
    Views:
    580
    Alex Papadimoulis
    Dec 12, 2003
  3. =?Utf-8?B?bXN1aw==?=

    Using one webform to set a value on another webform

    =?Utf-8?B?bXN1aw==?=, Jul 12, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    530
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Jul 12, 2006
  4. =?Utf-8?B?Vk1J?=

    Moving value from popup Webform to main Webform?

    =?Utf-8?B?Vk1J?=, Oct 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    626
    GroupReader
    Oct 9, 2006
  5. Luqman
    Replies:
    2
    Views:
    705
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Apr 11, 2007
Loading...

Share This Page