|
|
|
== Form.htm == <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Untitled Page</title>
</head> <body> <h1 align="center" style="font-style:italic; background:Red"> Testing</h1> <form action="formhandle.aspx" method=get> Name:
<input id="Text1" name="username" value="DMIS" type="text" /> <br /> <input id="Checkbox1" type="checkbox" name="skills" value="HTML" /> do you know HTML<br /> <input id="Checkbox2" name="skills" type="checkbox" value="ASP.NET" /> do you know ASP.NET<br />
<input id="Radio1" name=color type="radio" /> red<br /> <input id="Radio2" name=color type="radio" /> Green<br /> <input id="Radio3" name=color value="b" type="radio" /> Blue<br /> <br />
<select id="Select1" name="tool" size=3 multiple> <option value="vwd1">Visual Web Developer 1</option> <option value="vwd2">Visual Web Developer 2</option> <option value="vwd3">Visual Web Developer 3</option> <option value="vwd4">Visual Web Developer 4</option> </select> <input id="Submit1" type="submit" value="submit" /> <input id="Reset1" type="reset" value="reset" />
</form>
</body> </html>
== Formhandle.aspx == <%@ Page Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<script runat="server">
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Label1.Text = "<br>Your name is" & Request.Params.Get("UserName")
If Request.Params.Get("skills") = "" Then Label1.Text &= "<br>Skills= " & "none" Else Label1.Text &= "<br>Skills= " & Request.Params.Get("skills") End If
Label1.Text &= "<br>Color selected= " & Request.Params.Get("color") Label1.Text &= "<br>Tool selected= " & Request.Params.Get("tool") If Request.Params.GetValues("tool") Is Nothing Then Label1.Text &= "<br>Tool selected= None"
Else Dim tool As String Label1.Text &= "<br>Tools selected= <ol> " For Each tool In Request.Params.GetValues("tool") Label1.Text &= "<li> " & tool Next Label1.Text &= "</ol> "
End If
End Sub </script>
<html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <%=Request.Params.Get("username")%> <form id="form1" runat="server"> <div> Data submitted: <br /> <br /> <asp:Label ID="Label1" runat="server" Width="216px"></asp:Label>
</div> </form> </body> </html>
|