0

I'm new to vb.net and have been asked to add a page that leads to other pages in an application. Basically a landing page that goes to one of three other pages dependent on what user intends.

Here is aspx code (not all of course but what's needed for redirect or transfer to page)

<asp:Button ID="btnGoMain" runat="server" Text="Create New" 
        Font-Names="Trebuchet MS" Font-Size="8pt" Width="80px" />
        <asp:Button ID="btnSave" runat="server" Text="Remove" 
        Font-Names="Trebuchet MS" Font-Size="8pt" Width="80px"  >
        <asp:Button ID="btnEdit" runat="server" Text=" Edit " 
        Font-Names="Trebuchet MS" Font-Size="8pt" Width="80px" />

here is .vb code behind that I've put together so far, not sure what else is needed. Getting error here..
Compiler Error Message: BC30001: Statement is not valid in a namespace.
Protected Sub btnNew_Click(ByVal.......

Partial Class StartServerReg
    Inherits System.Web.UI.Page
End Class

Protected Sub btnNew_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNew.Click
    Response.Redirect("NewRec.aspx")
End Sub
Protected Sub btnRem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRem.Click
    Response.Redirect("EditRec.aspx")
End Sub
Protected Sub btnEdit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnEdit.Click
    Response.Redirect("RemoveRec.aspx")
End Sub

Edited by __avd: Added [code] tags. Encase your code in: [code] and [/code] tags.

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by LaSalle5067
0

I changed a few thinks in aspx.vb (code behind) page...and now it works.

Partial Class StartNewEditRem
    Inherits System.Web.UI.Page
    Protected Sub btnNew_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNew.Click
        Response.Redirect("NewRec.aspx")
    End Sub
    Protected Sub btnRem_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRem.Click
        Response.Redirect("NewRec.aspx")
    End Sub
    Protected Sub btnEdit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnEdit.Click
        Response.Redirect("ShowGrid.aspx")
    End Sub
End Class

Edited by __avd: Added [code] tags. Encase your code in: [code] and [/code] tags.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.