找大虾们帮忙,小弟在此谢过!
使用request返回调查表中输入的东西,才学没多久不知道怎么做了,请高手指点!谢谢!调查表中aspx代码为:
<html xmlns="http://www. >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server" action="output.aspx" method="post">
<table style="width: 457px; height: 361px; background-color: lightblue;",border="1",align="center" >
<tr>
<td >
<h2 style="text-align:center">调查表</h2>
<hr style="size:inherit"/>
用 户 名:<input id="Text1" runat="server" name="love" type="text" style="width: 155px" /><br />
输入密码:<input id="Password1" runat="server" name="love" type="password" style="width: 155px" /><br />
密码校对:<input id="Password2" runat="server" name="love" type="password" style="width: 155px" /><br />
真实姓名:<input id="Text2" runat="server" name="love" type="text" style="width: 155px" /><br />
电子邮箱:<input id="Text3" runat="server" name="love" type="text" style="width: 155px" /><br />
住址:<input id="Text4" runat="server" name="love" type="text" style="width: 155px" /><br />
院系:<input id="Text5" runat="server" name="love" type="text" style="width: 155px" /><br />
留言:<br />
<textarea id="TextArea1" runat="server" cols="60" name="love" rows="4"></textarea><br />
所在城市:<select id="Select1" runat="server" name="love" size="1">
<option selected="selected">北京市</option>
<option>郑州市</option>
<option>南昌市</option>
<option>海口市</option>
<option>昆明市</option>
<option></option>
</select><br />
个人爱好:<input id="Checkbox1" runat="server" name="love" style="width: 17px; height: 18px;" type="checkbox" value="足球" />
足球
<input id="Checkbox2" name="love" type="checkbox" value="乒乓球" />
乒乓球
<input id="Checkbox3" name="love" type="checkbox" value="绘画" />
绘画
<input id="Checkbox4" name="love" type="checkbox" value="音乐" />
音乐
<input id="Checkbox5" name="love" type="checkbox" value="唱歌" />
唱歌
<input id="Checkbox6" name="love" type="checkbox" value="围棋" />
围棋<br />
性别:<input id="Radio1" name="love" type="radio" value="男" />
男
<input id="Radio2" name="love" type="radio" value="女" />
女<br />
血型:<input id="Radio3" name="love" type="radio" value="A" />
A<input id="Radio4" name="love" type="radio" value="B" />
B
<input id="Radio5" name="love" type="radio" value="AB" />
AB
<input id="Radio6" name="love" type="radio" value="C" />
O<br />
<input id="Submit1" type="submit" value="提交" /></td>
</tr>
</table>
</form>
</body>
</html>
用来显示的页面的aspx代码为:
<html xmlns="http://www. >
<head runat="server">
<title>无标题页</title>
</head>
<body style="background-color:skyblue">
<form id="form1" runat="server">
<div>
<p style="text-align:center"><b style="color:Red">你提交的调查表内容如下所示:</b></p>
</div>
<%
NameValueCollection coll = Request.Form;
string[] arr1 = coll.AllKeys;
string[] arr2 = coll.GetValues(arr1[0]);
Response.Write("用户名为:"+arr2[0]+"<br/>");
arr2 = coll.GetValues(arr1[1]);
Response.Write("第一次输入密码为:" + arr2[0] + "<br/>");
arr2 = coll.GetValues(arr1[2]);
Response.Write("第二次输入密码为:" + arr2[0] + "<br/>");
arr2 = coll.GetValues(arr1[3]);
Response.Write("真实姓名为:" + arr2[0] + "<br/>");
arr2 = coll.GetValues(arr1[4]);
Response.Write("电子信箱为:" + arr2[0] + "<br/>");
arr2 = coll.GetValues(arr1[5]);
Response.Write("你的住址为:" + arr2[0] + "<br/>");
arr2 = coll.GetValues(arr1[6]);
Response.Write("你的院系为:" + arr2[0] + "<br/>");
arr2 = coll.GetValues(arr1[7]);
Response.Write("你的留言为:" + arr2[0] + "<br/>");
arr2 = coll.GetValues(arr1[8]);
Response.Write("你所在的城市为:" + arr2[0] + "<br/>");
arr2 = coll.GetValues(arr1[9]);
Response.Write("你的爱好为:" + arr2[0] + "<br/>");
arr2 = coll.GetValues(arr1[10]);
Response.Write("你的性别为:" + arr2[0] + "<br/>");
arr2 = coll.GetValues(arr1[11]);
Response.Write("你的血型为:" + arr2[0] + "<br/>");
%>
</form>
</body>
</html>