droplist not declared ?

T

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="" />
 
E

Eliyahu Goldin

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

Eliyahu
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top