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

  • SEARCH
  • Home
  • 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 8608193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:32:43+00:00 2026-06-12T03:32:43+00:00

When cliking the button form post is not working. Guys any idead ? Razor

  • 0

When cliking the button form post is not working. Guys any idead ?

Razor VIew

<div id="contactform">
    <h3>
        Contact Form</h3>
    @using (Html.BeginForm("contacts", "Home"))
    {
        @Html.AntiForgeryToken()
        @Html.ValidationSummary()


        <fieldset>
            <ol>
                <li>
                    @Html.TextBoxFor(m => m.Name)
                    @Html.ValidationMessageFor(m => m.Name)
                </li>
                <li>
                    @Html.TextBoxFor(m => m.Email)
                    @Html.ValidationMessageFor(m => m.Email)
                </li>
                <li>

                    @Html.TextBoxFor(m => m.Phone)
                    @Html.ValidationMessageFor(m => m.Phone)
                </li>
                <li>

                    @Html.TextAreaFor(m => m.Message)
                    @Html.ValidationMessageFor(m => m.Message)
                </li>
            </ol>
            <input type="button" value="contacts"/>
        </fieldset>

    }
</div>

Model

public class ContactModel
{
    [Required]
    [DataType(DataType.Text)]
    [Display (Name="Name")]  
    public string Name { get; set; }

    [Required]
    [DataType(DataType.EmailAddress)]
    [Display (Name="Email")]
    public string Email { get; set; }

    [Required]        
    [Display (Name="Phone")]
    public string Phone { get; set; }

    [Required]
    [DataType(DataType.MultilineText)]
    [Display(Name = "Message")]   
    public string Message { get; set; }


}

Home Controller

[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult contacts(ContactModel contact)
{
    if (ModelState.IsValid)
    {

    }


    return View();
}
  • 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-06-12T03:32:44+00:00Added an answer on June 12, 2026 at 3:32 am

    If you want to submit your data to the server you need a submit button in order to the browser (if you are not posting with javascript) sends your data to the server

    So change:

    <input type="button" value="contacts"/>
    

    to:

    <input type="submit" value="contacts"/>
    

    and it should work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have form where before i was using simple post with <button name=submit id=register
I am working on a dynamic search view wherein clicking a button should add
I'd like to mimic html form behaviour using jquery. When clicking on a button,
I have a form which is given below : <form method=post id=contactForm action=> <fieldset
MVC 3 VB.NET applicaiton... Using express checkout with html razor view. I have tried
I'm having trouble getting my form submission working. I'm using a preventDefault in order
I have a drupal form which i post using jquery when you select an
I have a JuiceUI button control that I use to post a form. When
Background I'm using POST form submissions instead of links with concatenated arguments inside a
When I want to Display a form (C#) by clicking a button in another

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.