如何将 aspx 页面的参数发布到 aspx 方法。不在 MVC 控制器方法中。这是我的视图,名称为 ViewController.ascx:
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<script runat="server">
protected void btnSubmit_Click(object sender, EventArgs e)
{
string postData = String.Empty;
postData += "pan=" + txtCardNumber.Text + "&";
}
</head>
<body>
<form id="paymentForm" runat="server">
<center>
<table class="tableClass">
<tr class="trHeader">
<td>
Kredi Kartı Numarası:
</td>
<td>
<asp:TextBox ID="txtCardNumber" runat="server" MaxLength="20" AutoCompleteType="None"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvCreditCardNumber" runat="server" ControlToValidate="txtCardNumber"
Display="Dynamic" Text="*"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<asp:Button ID="btnSubmit" runat="server" CssClass="buttonClass" Text="Gönder" CausesValidation="true"
OnClick="btnSubmit_Click" />
</td>
</tr>
</table>
</body>
</html>
因此,当我发布数据时,我的参数转到控制器操作方法,如何将这些参数发送到 aspx 方法?