Possible Duplicate:
Html.BeginForm() with an absolute URL?
How to put and absolute URI in the action attribute of the <form> tag generated by the Html.BeginForm() MVC3 Html helper. I am using MVC3 validation and do not want to lose it by writing my own Form tags.
I tried out both Html.BeginForm(new { action ="http://absolute.com"}) and Html.BeginForm(new { @action ="http://absolute.com"}) and the rendered html was <form action="/Pro/Contact/http%3a/absolute.com/">. As you can see it is being appended instead of replaced.
BeginFormmethod with single parameter is used to generate a relative path from routedata that is provided within parameter variable. Which means, that you are setting URI parameter with nameactionand giving it and valuehttp://absolute.com, therefor value is going to be encoded.What you want to use is overload where it asks you for htmlAttributes.
This will not encode value for action attribute:
UPDATE: method show below will not utilize JavaScript client-side validation.
since, you don’t really need the helper to figure out the path of the form. You can use the html and set action of the form manually.
Validation will still work, if you are using helpers for the input fields.