2 Replies - 1486 Views - Last Post: 31 January 2010 - 06:54 PM Rate Topic: -----

#1 Sue816   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 92
  • Joined: 22-April 09

Name of Drop Down List not delcared?

Posted 31 January 2010 - 01:49 PM

I am trying to use this code:

 Partial Class Order
	Inherits System.Web.UI.Page

	Private selectedProduct As Product

	Protected Sub Page_Load(ByVal sender As Object, _
							ByVal e As System.EventArgs) Handles Me.Load
		If Not IsPostBack Then
			ddlProducts.Databind()
		End If




where "ddlProducts" is the name of the Drop Down List I've added to the Default.aspx form. Specifically, I set that name in Misc. and then "ID" in its properties.

Whenever I try to use ddlProducts, like in the code shown above, I get an error that says Name 'DDLProducts' is not declared.

Do you know where else I would have to declare it??

Is This A Good Question/Topic? 0
  • +

Replies To: Name of Drop Down List not delcared?

#2 Sue816   User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 92
  • Joined: 22-April 09

Re: Name of Drop Down List not delcared?

Posted 31 January 2010 - 02:40 PM

Nevermind, I had been typing the code in the wrong place. :P
Was This Post Helpful? 0
  • +
  • -

#3 Imdsm   User is offline

  • D.I.C Regular
  • member icon

Reputation: 104
  • View blog
  • Posts: 362
  • Joined: 21-March 09

Re: Name of Drop Down List not delcared?

Posted 31 January 2010 - 06:54 PM

Glad you fixed it, but just for future reference, if you have a problem like this again, post both the aspx and the vb/cs files :) much easier to debug with both sides of the code!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1