asp.net - asp.net 中的 Paypal 表单标记问题

标签 asp.net c#-4.0 button paypal

大家好,我在加载 asp.net 时遇到问题

我在子页面中使用了母版页,母版页中有一个表单标签,我在子页中添加了一个 paypal 按钮,这在母版页中的表单标签也很重要

在母版页中 <form id="form1" runat="server"></form>

在晚饭中

 <form id="form2" runat="server" name="Paypal" action="https://www.paypal.com/cgi-bin
          /webscr"
              method="post">
              <input type="hidden" name="cmd" value="_cart" />
              <input type="hidden" name="upload" value="1" />
              <input type="hidden" name="business" value="
   <%=System.Web.Configuration.WebConfigurationManager.AppSettings["email"] %>
    " />
  <input type="hidden" name="item_name_1" value="<%=Session["ItemName"].ToString()%>" 
       />
  <input type="hidden" name="amount_1" value="<%=Session["ItemCost"].ToString() %>"/>
  <input type="hidden" name="quantity_1" value="1" />
  <input type="hidden" name="currency_code" value="USD" />
  <input type="hidden" name="return" value="<%=Session["returnUrl"].ToString() %>"/>
  <input type="hidden" name="lc" value="Stronger" />
  <input type="image" src="images/paynow.png" border="0" name="submit" alt="Make
         payments with PayPal - it's fast, free and secure!"
           style="background: url(images/update-account.png);"/>
</form>

我在下面的子页面中遇到了这个问题

“/Project”应用程序中的服务器错误。 一个页面只能有一个服务器端表单标记。 描述:当前web执行过程中出现未处理的异常 要求。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。

异常详细信息:System.Web.HttpException:一个页面只能有一个服务器端表单标记。

任何人都知道如何在子页面中使用表单标签。

最佳答案

请检查有多少<form>标记写在您的 aspx/html 页面上。确保您没有为此页面使用母版页。

关于asp.net - asp.net 中的 Paypal 表单标记问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19090374/

相关文章:

.net - Nhibernate更新问题-参数索引超出范围

c# - 动态类型的默认值?

c# - 使用c#获取chrome浏览器标题

android - 如何通过java代码去除checkbox的按钮图片?

CSS 按钮样式和对齐方式

javascript - 页面无法重定向并清除 URL 参数

c# - 如何用 StreamWriter 写特殊字符 (é, è)?

ASP.NET 登录页面加载非常慢需要 30 秒

C# 搜索 "Did you mean"功能

c# - Entity Framework 插入空记录