加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – Internet Explorer嵌套表单帖子

发布时间:2020-12-16 03:41:08 所属栏目:asp.Net 来源:网络整理
导读:我正在使用ASP.NET MVC创建一个发布到Paypal沙箱的页面.发布到Paypal网站的表单嵌套在父表单中.我正在使用Internet Explorer 7,由于某种原因,嵌套表单发布到我的本地计算机而不是paypal网站.如果我在第一个之后直接添加相同嵌套表单的副本,则第一个发布到loc
我正在使用ASP.NET MVC创建一个发布到Paypal沙箱的页面.发布到Paypal网站的表单嵌套在父表单中.我正在使用Internet Explorer 7,由于某种原因,嵌套表单发布到我的本地计算机而不是paypal网站.如果我在第一个之后直接添加相同嵌套表单的副本,则第一个发布到localhost,第二个发布到期望的位置.

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>
    </title>
</head>
<body>
    <form name="aspnetForm" method="post" action="" id="aspnetForm">        
        <!--First form posts locally-->
        <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
            <input type="submit" value="Pay"/>
        </form>     

        <!--Second identical form posts to the expected destination-->
        <form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">     
            <input type="submit" value="Pay"/>
        </form> 
    </form>

解决方法

嵌套表单不是vaild,因此它们的行为是未定义的.你就是无法嵌套它们.虽然您可以在页面上放置多个未通过的表单(但只提交相应的提交按钮之一),但一次只能提交一个表单.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读