'############################################################################## ' Author: Kevin Koch ' Description: This class is a simple custom user control allowing ' navigation around the application '############################################################################## Public MustInherit Class NavBar Inherits System.Web.UI.UserControl Protected WithEvents btnSearch As System.Web.UI.WebControls.Button Protected WithEvents btnCart As System.Web.UI.WebControls.Button Protected WithEvents Label1 As System.Web.UI.WebControls.Label Protected WithEvents lblCartNum As System.Web.UI.WebControls.Label Protected WithEvents btnMyOrders As System.Web.UI.WebControls.Button Protected WithEvents btnLogin As System.Web.UI.WebControls.Button #Region " Web Form Designer Generated Code " 'This call is required by the Web Form Designer. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() End Sub Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init 'CODEGEN: This method call is required by the Web Form Designer 'Do not modify it using the code editor. InitializeComponent() End Sub #End Region Public Shared CART_NUM_REF As String = "CART_NUM" Public Shared BOOK_IDS_REF As String = "BOOK_IDS" Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here End Sub Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click Response.Redirect(WebPageNames.LOGIN_FORM, False) End Sub Private Sub btnCart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCart.Click Response.Redirect(WebPageNames.VIEW_CART) End Sub Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click Response.Redirect(WebPageNames.SEARCH_BOOKS, False) End Sub Private Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.PreRender ' Display the number of cart items in this event handler so any modifications to the session variable ' will be displayed correctly Me.lblCartNum.Text = CType(Session.Item(ClientSession.CLIENT_SESSION_REF), ClientSession).NumItems.ToString() End Sub Private Sub btnMyOrders_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnMyOrders.Click Response.Redirect(WebPageNames.VIEW_CUSTOMER_ORDERS, False) End Sub End Class |