Live Chat Icon For mobile
Live Chat Icon

How to disable a Dropdownlist once someone has selected an item in the Dropdownlist

Platform: ASP.NET| Category: Client Side Scripting

<asp:DropDownList id='DropDownList1' runat='server'>
	<asp:ListItem Value='Red'>Red</asp:ListItem>
	<asp:ListItem Value='Blue'>Blue</asp:ListItem>
	<asp:ListItem Value='Green'>Green</asp:ListItem>
</asp:DropDownList>

VB.NET


DropDownList1.Attributes.Add('onChange','this.disabled=true;' )

C#


DropDownList1.Attributes.Add('onChange','this.disabled=true;' );

Share with

Share on twitter
Share on facebook
Share on linkedin

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.