Reputation: 193
i trying to use DropDownList in code behind but i get an error - the visual studio dont recognized the dropdownlist.
I was trying to put the "System.Web.UI.WebControls.DropDownList" statment but nothing changed.
This is my current statment:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;
using System.Web.Configuration;
using System.Text;
using System.Configuration;
Upvotes: 0
Views: 25
Reputation: 28741
Add namespace below
using System.Web.UI.WebControls;
If this still does not work ,try rebuilding the project. In Visual Studio , go to Build menu and select Rebuild option.
Upvotes: 0
Reputation: 1737
You are missing these two namespaces
using System.Web.UI;
using System.Web.UI.WebControls;
if you are using ASP.NET
try this code hope it will help.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public void loadSuppliers(DropDownList ddl)
{
}
Upvotes: 3