Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: page redirect

  1. #1
    New Coder
    Join Date
    Jan 2007
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    page redirect

    can anyone give me the code to navigate from one page to another in an aspx page please, when a button is pressed.

  • #2
    New Coder
    Join Date
    Mar 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well you could just do it with html?

    But i guess you could also put response.redirect("page.aspx") in the button sub as well, good luck.
    Last edited by NuneatonSam; 02-21-2007 at 01:52 AM.

  • #3
    Regular Coder Freon22's Avatar
    Join Date
    May 2005
    Location
    USA
    Posts
    287
    Thanks
    3
    Thanked 5 Times in 5 Posts
    Quote Originally Posted by Richiet23 View Post
    can anyone give me the code to navigate from one page to another in an aspx page please, when a button is pressed.
    You should give a little more information on what you are trying to do.

    If all you what to do is move from one page to another a hyperlink will work just fine.
    Code:
    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="test.aspx">HyperLink</asp:HyperLink>
    But if you what to do some type of program logic then maybe a button is one way of doing it.
    Code:
    Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
            If Islogin = True Then
                Response.Redirect("test.aspx")
            Else
                Response.Redirect("noaccess.aspx")
            End If
    
        End Sub
    Hope this helps.

  • #4
    New Coder
    Join Date
    Jan 2007
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    done it now thanks, thank you for your help


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •