MVC HtmlHelpers遇到Razor问题
|
我正在使用一个非营利性捐赠平台,并且是第一次使用MVC。我大部分都掌握了它,但是现在我遇到了一个我不知道该如何解决的问题。我使用的是AthorizeNet.Helpers类,当我从示例中添加代码时,它在大多数情况下都可以工作,除了它采用表格并将其放在标签上方,但是将表格字段放在正确的位置。我正在尝试弄清楚如何在正确的位置呈现标记。
@using AuthorizeNet.Helpers;
@using (Html.BeginSIMForm(\"http://127.0.0.1:4768\", 1.99M, \"xxx_key\", \"yyy_key\", true))
{
@Html.Raw(Html.CheckoutFormInputs(true))
@Html.Hidden(\"order_id\", \"1234\")
<input type = \"submit\" value = \"Pay\" />
}
这是它在HTML输出中的外观:
<form action = \'https://test.authorize.net/gateway/transact.dll\' method = \'post\'>
<input type = \'hidden\' name = \'x_fp_hash\' value = \'6bef386eaa89944efd62b47b86042910\' \\>
<input type = \'hidden\' name = \'x_fp_sequence\' value = \'117\'\\>
<input type = \'hidden\' name = \'x_fp_timestamp\' value = \'xxx_key\' \\>
<input type = \'hidden\' name = \'x_login\' value = \'yyy_key\' \\>
<input type = \'hidden\' name = \'x_amount\' value = \'1.99\' \\>
<input type = \'hidden\' name = \'x_relay_url\' value = \'http://127.0.0.1:4768\' \\>
<input type = \'hidden\' name = \'x_relay_response\' value = \'TRUE\' \\>
</form><!DOCTYPE html>
<html>
<body>
<h2>Payment Information</h2>
<div style = \'border: 1px solid #990000; padding:12px; margin-bottom:24px; background-color:#ffffcc;width:300px\'>Test Mode</div>
<div style = \'float:left;width:250px;\'>
<label>Credit Card Number</label>
<div id = \'CreditCardNumber\'>
<input type = \'text\' size = \'28\' name = \'x_card_num\' value = \'4111111111111111\' id = \'x_card_num\'/>
</div>
</div>
<div style = \'float:left;width:70px;\'>
<label>Exp.</label>
<div id = \'CreditCardExpiration\'>
<input type = \'text\' size = \'5\' maxlength = \'5\' name = \'x_exp_date\' value = \'0116\' id = \'x_exp_date\'/>
</div>
</div>
<div style = \'float:left;width:70px;\'>
<label>CCV</label>
<div id = \'CCV\'>
<input type = \'text\' size = \'5\' maxlength = \'5\' name = \'x_card_code\' id = \'x_card_code\' value = \'123\' />
</div>
</div><input id=\"order_id\" name=\"order_id\" type=\"hidden\" value=\"1234\" /> <input type = \"submit\" value = \"Pay\" />
没有找到相关结果
已邀请:
5 个回复
春驹晴陪
在更高版本的ASP.NET MVC中,您应该使用以下版本:
这样可以确保Razor的兼容性。如果您有权访问AuthorizeNet.Helpers源代码,则可以自己进行修复,如果您不这样做,则必须联系作者进行修复。
闯舱酮
添加使用
更改
我做到了三个点。
还剩两个更改 按照tpeczek答案中的指示,您需要进行更改
至
这看起来像
藐刚
靛取糕奖穿
一旦完成该操作,便可以发布该表单,但是这样做之后,我得到了已解决的错误。 http://community.developer.authorize.net/t5/Integration-and-Testing/Having-Trouble-setting-up-MVC3-application-with-DPM/m-p/13226
佬棠
cshtml:
在您的操作中使用thankUrl处理来自Authorize.net的响应。进一步检查:http://developer.authorize.net/integration/fifteenminutes/csharp/