while | if | dropdownlist in javascript
int i = 0;
int indx = drpdwn.SelectedIndex;
int var = 3;
while (i <= var)
{
if (i == indx)
{
// lbl.Text = "you have selected" + indx;
one.Text =Convert.ToString(indx * 8);
break;
}
else
{
i++;
}
}
<table>
<tr><td>
<asp:DropDownList ID="drpdwn" runat="server" AutoPostBack="True"
ontextchanged="drpdwn_TextChanged">
<asp:ListItem Value="1">Java Programming</asp:ListItem>
<asp:ListItem Value="2">C Programming</asp:ListItem>
<asp:ListItem Value="3">Asp Programming</asp:ListItem>
<asp:ListItem Value="4">c++ Programming</asp:ListItem>
</asp:DropDownList>
</td></tr>
<tr><td>
<asp:Label runat="server" ID="lbl"></asp:Label>
</td></tr>
</table>
int i = 0;
int indx = drpdwn.SelectedIndex;
int var = 3;
while (i <= var)
{
if (i == indx)
{
// lbl.Text = "you have selected" + indx;
one.Text =Convert.ToString(indx * 8);
break;
}
else
{
i++;
}
}
<table>
<tr><td>
<asp:DropDownList ID="drpdwn" runat="server" AutoPostBack="True"
ontextchanged="drpdwn_TextChanged">
<asp:ListItem Value="1">Java Programming</asp:ListItem>
<asp:ListItem Value="2">C Programming</asp:ListItem>
<asp:ListItem Value="3">Asp Programming</asp:ListItem>
<asp:ListItem Value="4">c++ Programming</asp:ListItem>
</asp:DropDownList>
</td></tr>
<tr><td>
<asp:Label runat="server" ID="lbl"></asp:Label>
</td></tr>
</table>
0 comments: