Search code examples
c#asp.netdrop-down-menuusing

Detecting DropDownList (Statement Issue)


i trying to use DropDownList in code behind but i get an error - the visual studio dont recognized the dropdownlist. enter image description here

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;

Solution

  • 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)
    {
    
    }