Showing next aspx page

Posted on 2005-04-15
Last Modified: 2010-04-23
I'm new to VB.NET and in VB6 I used to write this to go to the next form.

Private Sub Button1_Click


End Sub

But in VB.NET that doesn't work.

I have a aspx page called Main.aspx and I have a button named button1, what code do I write so that when I click on button1 it goes to the next aspx page called "search.aspx"?
Question by:johnqtr
    LVL 44

    Expert Comment

    with .NET there is no such things as the VB6 Forms collection.  YOu must create an instance of the form you want to use, sort of like this:

    Private Sub Button1_Click(ByVal sender as Object, ByVal e as System.EventArgs)

       Dim frm2 as New Form2

       frm2.Show vbModal

    End Sub
    LVL 44

    Accepted Solution

    and ASP.NET is NOTHING at all like that.  to move to another ASP.NET page, you use:


    and NOT form.Show

    On the Web Form, after placing the Command Button, simply double-click on teh copmmand button, and then add this line to the Click event handler in the code-behind.


    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
    1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now