Tuesday, April 1, 2008

TY SAMS ASP.NET Excercise

Build an app that choose a baby name. The user will select the sex of the baby and then a list box will display with few possible names. Select a name , a message will be displayed using a selected name.

Ans.:

%@ Page Language="VB" %>
html>

body>
form id="frm" runat="Server">
h3>Select a baby name/h3>
Select the baby sex:
asp:RadioButtonList ID="sex" runat="Server" AutoPostBack="true" OnSelectedIndexChanged="one">
asp:ListItem>Male
asp:ListItem>Female
/asp:RadioButtonList>
Br />
asp:DropDownList ID="malename" runat="Server" Visible="false" AutoPostBack="true" OnSelectedIndexChanged="male">
asp:ListItem>dina
asp:ListItem>mani
asp:ListItem>srini
asp:ListItem>ramesh
/asp:DropDownList>
Br />
asp:DropDownList ID="femalename" runat="Server" Visible="False" autopostback="true" OnSelectedIndexChanged="female">
asp:ListItem>swetha
asp:ListItem>pinku
asp:ListItem>puppy
asp:ListItem>rajini
/asp:DropDownList>
asp:Label ID="vis" runat="Server">
/form>
/body>
/html>

No comments: