function Shape() { var lbl1=document.getElementById("<%= Label3.ClientID%>"); var ddshap=document.getElementById("<%= ddshpe.ClientID%>"); if(ddshap.value=='Rectangular') { lbl1.innerHTML='Length of sample in cm'; document.getElementById("rectangular").style.display = ''; } else { lbl1.innerHTML='Diameter of sample in cm'; document.getElementById("rectangular").style.display = 'none'; } }
<asp:DropDownList ID="ddshpe" runat="server" Height="22px" onchange="Shape();" CssClass="Textbox"> <asp:ListItem>Rectangular</asp:ListItem> <asp:ListItem>Cylindrical</asp:ListItem> </asp:DropDownList>
protected void Page_Load(object sender, EventArgs e) { ddshpe.Items.FindByText("Cylindrical").Selected = true; }
id
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)