【发布时间】:2014-06-09 02:07:01
【问题描述】:
我有一个简单的 ASP.NET MVC 表单,其代码如下:
@using (Html.BeginForm(null, null, FormMethod.Post, new
{
action = "https://secure.authorize.net/gateway/transact.dll",
id = "registerformid",
}))
{
@Html.HiddenFor(a => a.RegisterUserInfoLoggedIn.AttendeesId)
...
我有一个 JQuery ajax 调用,如果该 JQuery 成功,我希望我的表单 POST 到操作 url 以进行进一步处理。
我的 JQuery 如下所示,但我不知道在我的 JQuery ajax 成功事件中放入什么,以便我回发到操作 url,该页面正确响应并向我显示我的新页面。
success: function (data) {
if (donationAmount > 0.00) {
$.post("https://secure.authorize.net/gateway/transact.dll", {
x_login: 'xxx',
x_amount: 19.99,
x_description: 'Sample Transaction',
...
}, function(datax) {
this.submit();
});
【问题讨论】:
-
你不能在你的成功函数中使用
$("#registerformid").submit()吗? -
这有帮助吗?在成功事件中放置 window.location.href = 'new page url';
标签: jquery asp.net asp.net-mvc asp.net-mvc-2