droplist not declared ?

Discussion in 'ASP .Net' started by TJS, Apr 7, 2005.

  1. TJS

    TJS Guest

    I am getting an error message saying HourDropList is not declared
    What declaration is required ?


    ......script function to populate droplist.....


    '*******************************************************
    Function HourDropDownList(byVal vHour As Integer)
    '
    ' The HourDropDownList method is used to
    ' populate HourDropList
    '
    '*******************************************************
    HourDropList.items.add(New ListItem(-1,"?"))
    HourDropList.items.add(New ListItem("1","1"))
    HourDropList.items.add(New ListItem("2","2"))
    HourDropList.items.add(New ListItem("3","3"))
    HourDropList.items.add(New ListItem("4","4"))
    HourDropList.items.add(New ListItem("5","5"))
    HourDropList.items.add(New ListItem("6","6"))
    HourDropList.items.add(New ListItem("7","7"))
    HourDropList.items.add(New ListItem("8","8"))
    HourDropList.items.add(New ListItem("9","9"))
    HourDropList.items.add(New ListItem("10","10"))
    HourDropList.items.add(New ListItem("11","11"))
    HourDropList.items.add(New ListItem("12","12"))

    Dim vID As String = Cstr(vHour) 'Always string
    If vHour > 0 then HourDropList.SelectedValue= vID

    End Function

    ........html........

    <asp:DropDownList
    id="HourDropList"
    AutoPostBack="false"
    runat="server" cssClass="" />
     
    TJS, Apr 7, 2005
    #1
    1. Advertising

  2. Patrick Olurotimi Ige, Apr 7, 2005
    #2
    1. Advertising

  3. Make sure your codebehind has definition for HourDropList. It is created
    automatically when you switch from html to design view.

    Eliyahu

    "TJS" <> wrote in message
    news:...
    > I am getting an error message saying HourDropList is not declared
    > What declaration is required ?
    >
    >
    > .....script function to populate droplist.....
    >
    >
    > '*******************************************************
    > Function HourDropDownList(byVal vHour As Integer)
    > '
    > ' The HourDropDownList method is used to
    > ' populate HourDropList
    > '
    > '*******************************************************
    > HourDropList.items.add(New ListItem(-1,"?"))
    > HourDropList.items.add(New ListItem("1","1"))
    > HourDropList.items.add(New ListItem("2","2"))
    > HourDropList.items.add(New ListItem("3","3"))
    > HourDropList.items.add(New ListItem("4","4"))
    > HourDropList.items.add(New ListItem("5","5"))
    > HourDropList.items.add(New ListItem("6","6"))
    > HourDropList.items.add(New ListItem("7","7"))
    > HourDropList.items.add(New ListItem("8","8"))
    > HourDropList.items.add(New ListItem("9","9"))
    > HourDropList.items.add(New ListItem("10","10"))
    > HourDropList.items.add(New ListItem("11","11"))
    > HourDropList.items.add(New ListItem("12","12"))
    >
    > Dim vID As String = Cstr(vHour) 'Always string
    > If vHour > 0 then HourDropList.SelectedValue= vID
    >
    > End Function
    >
    > .......html........
    >
    > <asp:DropDownList
    > id="HourDropList"
    > AutoPostBack="false"
    > runat="server" cssClass="" />
    >
    >
     
    Eliyahu Goldin, Apr 7, 2005
    #3
  4. TJS

    TJS Guest

    um...
    that was my question...

    "What declaration is required ?"


    "Patrick Olurotimi Ige" <> wrote in message
    news:...
    > TJS did you declare it?
    >
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
     
    TJS, Apr 7, 2005
    #4
  5. TJS

    TJS Guest

    I have no codebehind ....
     
    TJS, Apr 7, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Meir Rotfleisch

    Newbie Question about DropList and Page Load

    Meir Rotfleisch, Nov 2, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    347
    Thomas F.B.
    Nov 2, 2003
  2. Lasse Edsvik

    Filelist -> Droplist?

    Lasse Edsvik, Oct 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    424
    =?Utf-8?B?c3Jpbmk=?=
    Oct 4, 2004
  3. TJS
    Replies:
    4
    Views:
    2,974
  4. TJS
    Replies:
    2
    Views:
    715
  5. JohnZing

    declared or not declared ?

    JohnZing, Feb 5, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    1,607
    Jon Paal
    Feb 5, 2006
Loading...

Share This Page