protected void Dropdownlist1_SelectedIndexChanged(object sender, EventArgs e) { TextBox1.Text=""; // Change value here }
you can do the same from aspx page also using javascript. follow the below code <asp:dropdownlist id="ddlreport" runat="server" onclick="fnconchange()" xmlns:asp="#unknown"> <asp:textbox id="txtname" runat="server"></asp:textbox> <script type="text/javascript"> function fnconchange() { var ddlReport = document.getElementById("<%=ddlreport.ClientID%>"); var Text = ddlReport.options[ddlReport.selectedIndex].text; var Value = ddlReport.options[ddlReport.selectedIndex].value; if(Value =="ram")//(your selected value { document.getElementById("<%=textBox.ClientID%>").value = "ram"; } } </script></asp:dropdownlist>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)