473,405 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

droplist not declared ?

TJS
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="" />
Nov 19 '05 #1
4 1045
TJS did you declare it?


*** Sent via Developersdex http://www.developersdex.com ***
Nov 19 '05 #2
Make sure your codebehind has definition for HourDropList. It is created
automatically when you switch from html to design view.

Eliyahu

"TJS" <no****@here.com> wrote in message
news:ef**************@TK2MSFTNGP14.phx.gbl...
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="" />

Nov 19 '05 #3
TJS
I have no codebehind ....
Nov 19 '05 #4
TJS
um...
that was my question...

"What declaration is required ?"
"Patrick Olurotimi Ige" <na********@hotmail.com> wrote in message
news:uI**************@TK2MSFTNGP10.phx.gbl...
TJS did you declare it?


*** Sent via Developersdex http://www.developersdex.com ***

Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mark | last post by:
Hi - if I have a string, "wine", how do I search through a droplist box, and automatically select the item that has "wine" as the text (nb. the value field will not be the same as the text)? eg:...
3
by: Stanley J Mroczek | last post by:
I am trying to load a droplist in VB when the edit is clicked in a datagrid. I tried to use OnDataBinding and loading the droplist in subroutine "loaddd". I get this error Object reference not set...
1
by: James | last post by:
I was wondering if there is a way to populate a drop down list with the active directory user? So far I have found the namespace System.DirectoryServices but I am not sure how to access the users...
4
by: TJS | last post by:
After a post back the selected index should be rest in a droplist to match user's choice, but page always show selected item as first one in the droplist. How can iforce the selected item to be...
2
by: TJS | last post by:
need help with trying to set selected value on a droplist. -- tried vCaptainID as integer and string , no luck -- tried it in pre render and also after droplist is created , no luck =========...
5
by: TJS | last post by:
I need to add validation to drodownlist control but it sends back an error message that says: "System.Web.UI.WebControls.DropDownList' does not allow child controls" the code is : If...
2
by: TJS | last post by:
I have a control, called FieldBuilder, which generates a droplist dynamically for a form. I want to add validation to the droplist thru the 'OnItemCreated' function. i can't seem to get the...
0
by: yuchang | last post by:
Hi, I try to use a droplist control to show a list value from Database table "A", and the droplist control is an item of a formview control, its data from Database table "B". My problem is how...
9
by: unlikeablePorpoise | last post by:
I would like to have an HTML dropdown list where each selection calls a method. The following code doesn't work, but it I hope it gives the idea of what I'm trying to do: <FORM NAME="frm">...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.