Wrox Programmer Forums
|
All Other Wrox Books Do you have a question about a Wrox book that isn't listed anywhere on p2p.wrox.com or where the forum is locked? Here's a forum to post questions about any other Wrox book so that other readers or one of the authors can help you with your questions. IF YOU ARE LOOKING FOR CODE DO NOT ASK "Where can I find the code for this book?" That question is answered here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the All Other Wrox Books section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 18th, 2004, 07:58 PM
Authorized User
 
Join Date: Oct 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 3 workjokeshop

Public Class DepartmentsList
    Inherits System.Web.UI.UserControl

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents list As System.Web.UI.WebControls.DataList

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    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

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim listIndex As String = Request.Params("departmentIndex")

        ' If listIndex has a value, this tells us that the visitor
        ' has clicked on a department, and we inform the DataList about that
        ' (so it can apply the correct template for the selected item)
        If Not listIndex Is Nothing Then
            list.SelectedIndex = CInt(listIndex)
        End If

        ' Create a new Catalog object
       Dim catalog As New Catalog

        ' GetDepartments returns a SqlDataReader object that has
        ' two fields: DepartmentID and Name. These fields are read in
        ' the SelectedItemTemplate and ItemTemplate of the DataList
        list.DataSource = catalog.GetDepartments()

        ' Needed to bind the child controls (the HyperLink controls)
        ' to the data source
        list.DataBind()
    End Sub

End Class

when i tried 2 build the solution it comes up with
The'catalog' is not defined

  #2 (permalink)  
Old February 18th, 2004, 07:59 PM
Authorized User
 
Join Date: Oct 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorry thats not the code here it is


Public Class DepartmentsList
    Inherits System.Web.UI.UserControl

#Region " Web Form Designer Generated Code "

    'This call is required by the Web Form Designer.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

    End Sub
    Protected WithEvents list As System.Web.UI.WebControls.DataList

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    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

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim listIndex As String = Request.Params("departmentIndex")

        ' If listIndex has a value, this tells us that the visitor
        ' has clicked on a department, and we inform the DataList about that
        ' (so it can apply the correct template for the selected item)
        If Not listIndex Is Nothing Then
            list.SelectedIndex = CInt(listIndex)
        End If

        ' Create a new Catalog object
        Dim catalog As New Catalog

        ' GetDepartments returns a SqlDataReader object that has
        ' two fields: DepartmentID and Name. These fields are read in
        ' the SelectedItemTemplate and ItemTemplate of the DataList
        list.DataSource = catalog.GetDepartments()

        ' Needed to bind the child controls (the HyperLink controls)
        ' to the data source
        list.DataBind()
    End Sub

End Class

  #3 (permalink)  
Old February 19th, 2004, 01:24 PM
Authorized User
 
Join Date: Oct 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok ive sorted!!! i called the catalog.vb clatalog which is why it didnt reconize it OOPS that had me stumped for hours!!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 2 - End of chapter exercises whizzkid1892 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 30th, 2008 12:02 PM
chapter 7 - chapter 11 pelopito BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 3 January 6th, 2008 11:40 AM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.