I’m implementing AuthorizeNet into my site and as per [this posting] I am to use something like:
@using (Html.BeginSIMForm("http://...", 1.99M, "...", "...", true))
{
@Html.CheckoutFormInputs(true);
@Html.Hidden("order_id", "1234");
<input type = "submit" value = "Pay" />
}
the trouble is that the BeginSIMForm method outputs HTML which, of course, gets escaped by Razor, so I need to output raw.
I’ve tried:
@Html.Raw(using(html.BeginSIMForm()) { ... })
but that’s no good. I can’t quite get the syntax right. is there a way to tell Razor to generate raw output between certain markers?
* update *
I missed something which was in the posting. what I need to do is wrap the call to .CheckoutFormInputs() like this:
@Html.Raw(Html.CheckoutFormInputs(true));
and that produces the right output… however, the call to .BeginSIMForm() produces output (a form) at the very top of my page and breaks everything. grr…
I’ve had a look at the source code for their helper. what garbage. I recommend anyone wanting to implement this service on Razor not bother downloading it. I will code the forms by hand. may come back with some code.