Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6161843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:32:52+00:00 2026-05-23T21:32:52+00:00

Possible Duplicate: Html.BeginForm() with an absolute URL? How to put and absolute URI in

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:32:53+00:00Added an answer on May 23, 2026 at 9:32 pm

    BeginForm method 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 name action and giving it and value http://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:

    @using (Html.BeginForm(
         null, null, FormMethod.Post,
         new {@action="http://absolute.com/submit/example"}
    )){}
    // the result is:
    <form action="http://absolute.com/submit/example" method="post"> 
    </form>
    

    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.

    <form action="http://absolute.com/submit/example" method="post">    
        @Html.LabelFor(model => model.Example)
        @Html.ValidationMessageFor(model => model.Example, "*")
        @Html.TextAreaFor(model => model.Example, 8, 60, null)
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: What are valid values for the id attribute in HTML? Underscores seem
Possible Duplicate: PHP: Strip a specific tag from HTML string? Hi All, I want
Possible Duplicate: Multiple submit buttons in an HTML form I have web form with
Possible Duplicate: Get content within a html tag using php and replace it after
Possible Duplicate: How do I set an HTML class attribute in Markdown? In my
Possible Duplicate: Editing MySQL recode using a HTML form Like to know how to
Possible Duplicate: Html validation error for property attribute According to facebook to use their
Possible Duplicate: How to get IMG tag code from HTML document? I need help
Possible Duplicate: Query about Html <input type=password> tag…? I want change the character displayed
Possible Duplicate: How to parse HTML with PHP? Grabbing the href attribute of an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.