| ตัวอย่าง Example |
|
<SCRIPT LANGUAGE=VB RUNAT=SERVER>
Sub Submit(Source As Object, e As EventArgs)
label1.Text = "Your name is "& Name.Text &"."
If Male.Checked = True Then
label2.Text = "Your sex is Male."
Else
label2.Text = "Your sex is Female."
End If
label3.Text = "Your education is "& StudyLevel.SelectedItem.Text &" degree."
label4.Text = "Your education code is "& StudyLevel.SelectedItem.Value &"."
End Sub
</SCRIPT>
<B><U>Questionnaire about education.</U></B>
<form runat=server>
Name : <asp:TextBox id="Name" runat="server" /><br />
Sex :
Male <asp:RadioButton id="Male" runat="server" GroupName="Sex" />
Female <asp:RadioButton id="Female" runat="server" GroupName="Sex" Checked /> <br />
Education :
<asp:DropDownList id="StudyLevel" runat="server">
<asp:ListItem Text="Bachelor" Value="0" />
<asp:ListItem Text="Master" Value="1" />
<asp:ListItem Text="Phd." Value="2" />
</asp:DropDownList>
<br />
<asp:Button id = "button1" Text = "Submit" OnClick="Submit" runat = "server" />
</form>
<asp:Label id="label1" runat="server" /><br />
<asp:Label id="label2" runat="server" /><br />
<asp:Label id="label3" runat="server" /><br />
<asp:Label id="label4" runat="server" /><br />
|
|
|