在同一页面处理提交代码
2008-09-19 14:21
204 查看
可用Request.ServerVariables("Request_Method")="POST"判断是否提交,如下dice.asp页面
<html>
<head><title>测试Request_Method</title></head>
<body>
<%
Session("point")=6
If Request.ServerVariables("Request_Method")="POST" then
%>
<form method="POST" action="dice.asp">
<p>当色子的面数为<input type="text" name="T1" size="5" value=<%=session("point") %>>时</p>
<p><input type="submit" value="掷色子" name="B1"></p>
</form>
<p>掷色子的结果为:5点</p>
<%
Else
%>
<form method="POST" action="dice.asp">
<p>当色子的面数为<input type="text" name="T1" size="5" value=<%=session("point") %>>时</p>
<p><input type="submit" value="掷色子" name="B1"></p>
</form>
<%
end if
%>
</body>
</html>
<html>
<head><title>测试Request_Method</title></head>
<body>
<%
Session("point")=6
If Request.ServerVariables("Request_Method")="POST" then
%>
<form method="POST" action="dice.asp">
<p>当色子的面数为<input type="text" name="T1" size="5" value=<%=session("point") %>>时</p>
<p><input type="submit" value="掷色子" name="B1"></p>
</form>
<p>掷色子的结果为:5点</p>
<%
Else
%>
<form method="POST" action="dice.asp">
<p>当色子的面数为<input type="text" name="T1" size="5" value=<%=session("point") %>>时</p>
<p><input type="submit" value="掷色子" name="B1"></p>
</form>
<%
end if
%>
</body>
</html>
相关文章推荐
- 在一个form用一个SUBMIT(或button)分别提交到两个处理表单页面的代码
- 在一个form用一个SUBMIT(或button)分别提交到两个处理表单页面的代码
- 在同一页面处理提交代码
- ASP.NET中防止页面多次提交的代码实现
- asp.net 中将表单提交到另一页Inline Code(代码和html在同一页面)
- (转载)处理F5刷新页面重复提交页面的一个思路
- jfinal将页面提交数组目标转换成List<Model> - 代码共享
- ajax提交session超时跳转页面使用全局的方法来处理
- ASP.NET中防止页面多次提交的代码实现
- ASP.NET中防止页面多次提交的代码实现
- 【point-2】可在后端规范划加工处理提交的Html 代码片
- asp.net 页面应用了 Transaction="Required" 报错“无法执行事务处理代码。
- 提交页面获取不到js向DropdownList写的Options的值,如何处理
- ajax提交session超时跳转页面使用全局的方法来处理
- ASP.NET中防止页面多次提交的代码实现
- javascript中alert()提交代码不刷新页面
- struts form表单提交action处理之后没有跳转页面
- html中提交表单并实现不跳转页面处理返回值
- 学习ThinkPHP3.2.2:video8,提交页面后的处理方法包括有效判断数据插入页面跳转功能
- 用C#向表单提交数据并且得到返回页面代码