WebControl Not declared... but it is? [RESOLVED]
Okay what's with this....
I added the DropDownList from the Web Controls toolbox and put it on my Webform1
I try to use code dropdownlist1.SelectedIndex = 1
But I get an error DropdownList1 is not declared.
I put it on the form and the html code shows that it is there.
What is wrong here?
I've got System.Web in my reference section of my solution.
Any ideas.. i am sure it's an easy answer.
Thanks
Re: WebControl Not declared... but it is?
Try to see if the following line of code exists under "Web Form Designer Generated Code" region.
VB Code:
Protected WithEvents DropDownList1 As System.Web.UI.WebControls.DropDownList
If it doesnt, add it and then compile your code.
~Nikhil
Re: WebControl Not declared... but it is?
Re: WebControl Not declared... but it is?
duh.... I had it spelled DropownList1
... left out the D
sorry