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

<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;' );

How to change the BackgroundColor of a page based on the value selected in a DropdownList

<asp:DropDownList id='DropDownList1' runat='server' AutoPostBack='True'> <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 Page.RegisterClientScriptBlock('BodyStyle', '<style type=’text/css’>body{background-color: ' + DropDownList1.SelectedItem.Value + ';}</style>') C# Page.RegisterClientScriptBlock('BodyStyle', '<style type=’text/css’>body{background-color: ' + DropDownList1.SelectedItem.Value + ';}</style>');

How to check/ uncheck a checkbox based on the text entered in textbox

<asp:CheckBox id='CheckBox1' runat='server'></asp:CheckBox> <asp:TextBox id='TextBox1' runat='server'></asp:TextBox> <script type='text/javascript'> function chkTextEntered() { document.getElementById('CheckBox1').checked = true; if(document.getElementById('TextBox1').value =='' ) { document.getElementById('CheckBox1').checked = false; } } </script> In Page_Load VB.NET TextBox1.Attributes.Add('onKeyDown', 'chkTextEntered();') C# TextBox1.Attributes.Add('onKeyDown', 'chkTextEntered();');