Hi mukesh1,
For disabling all item loopthrough each item and add disable attribute.
Check the below example.
HTML
<asp:DropDownList ID="ddlFruits" runat="server">
<asp:ListItem Text="Please select" Value="0" />
<asp:ListItem Text="Mango" Value="Mango" />
<asp:ListItem Text="Apple" Value="Apple" />
<asp:ListItem Text="Banana" Value="Banana" />
<asp:ListItem Text="Orange" Value="Orange" />
</asp:DropDownList>
C#
protected void Page_Load(object sender, EventArgs e)
{
for (int i = 0; i < ddlFruits.Items.Count; i++)
{
ddlFruits.Items[i].Attributes["disabled"] = "disabled";
}
}
VB.Net
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
For i As Integer = 0 To ddlFruits.Items.Count - 1
ddlFruits.Items(i).Attributes("disabled") = "disabled"
Next
End Sub