submit 跳转

wh_xiexing 2008-06-04 08:04:11
<body>
<form id="form1" runat="server" action = "~/mail2customer.aspx" method ="post"
name="form1" >
<table width="860" border="0" align="center" cellpadding="0" cellspacing="0"
style="height: 339px">
<tr>
<td valign="top" align="center" class="style1">
<div>
订单处理</div>
<br />
</td>
</tr>
<tr valign="top">
<td align="center" class="style3">
<!--product-->
<textarea id="TextArea1" name="S1"></textarea></td>
</tr>
<tr valign="center">
<td align="center" class="style2">
<input id="Submit1" type="submit" value="submit" align="middle"/></td>
</tr>
</table>

</form>
</body>

我写了个简单的表单,如上。 怎么电击按钮, 它不会跳转到 mail2customer.aspx页面呢。
...全文
436 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
kong521 2008-06-04
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 amandag 的回复:]
HTML code<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" PostBackUrl="~/mail2customer.aspx" />
</div>
</form>
</body>
</html>

在mail2cu…
[/Quote]
也可以用server.transfor跳转
transfor可能错了你用server.就出来了你选下
然后在第二个页面用Request.Form[]接收
另外可以用session传值
好多传值的方法呢
喜欢用哪种就用哪种
amandag 2008-06-04
  • 打赏
  • 举报
回复
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" PostBackUrl="~/mail2customer.aspx" />
</div>
</form>
</body>
</html>


在mail2customer.aspx页面中,可以使用Request.Form["TextBox1"]得到提交文本框的值
jerry1819 2008-06-04
  • 打赏
  • 举报
回复
页面你还是要提交的
你先做个普通的按钮 然后用JS编写onclick事件 在JS里验证 是否要提交
wh_xiexing 2008-06-04
  • 打赏
  • 举报
回复
自己顶一下
wh_xiexing 2008-06-04
  • 打赏
  • 举报
回复
呵呵, 我明白啦, 是不是asp.net 里面所有的按钮都要写onclick事件。然后在事件里写
Response.Redirect(。。。)啊。
但如果这样,我怎么把第一个页面里的内容带到第二个页面呢?
wh_xiexing 2008-06-04
  • 打赏
  • 举报
回复
我拖入的是html 控件啊。两位能否讲的详细些么。 不明白啊。
以前写简单的html页面都是这么做的吧
jerry1819 2008-06-04
  • 打赏
  • 举报
回复
用JS做
sz_free_bird 2008-06-04
  • 打赏
  • 举报
回复
你以前搞asp的么。如果你的Button是服务器控件。页面只是回发。不是提交

62,075

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧