Results 1 to 4 of 4

Thread: WebControl Not declared... but it is? [RESOLVED]

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Resolved 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
    Last edited by epixelman; Jun 13th, 2005 at 05:28 AM.

  2. #2
    Member Nikhil Aggarwal's Avatar
    Join Date
    Jun 2005
    Location
    New Delhi, India
    Posts
    36

    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:
    1. Protected WithEvents DropDownList1 As System.Web.UI.WebControls.DropDownList
    If it doesnt, add it and then compile your code.

    ~Nikhil

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: WebControl Not declared... but it is?

    yes, it is there.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2003
    Posts
    1,005

    Re: WebControl Not declared... but it is?

    duh.... I had it spelled DropownList1

    ... left out the D

    sorry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width