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 8423467
In Process

The Archive Base Latest Questions

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

So im new to MVC3 and expirimenting with DataAnnotations for the validation. All is

  • 0

So im new to MVC3 and expirimenting with DataAnnotations for the validation.
All is working fine clientside, but how do I get the serverside version working?
If I disable Javascript then there are no validations to be seen.

My Model looks like this

[Required(ErrorMessageResourceName = "Verplicht", ErrorMessageResourceType = typeof (ValidatieStrings))]
    [Display(Name="Voorletters", ResourceType = typeof (VeldNaamStrings))]
    public string Voorletters { get; set; }

My Controller looks like this

using System.Web.Mvc;
using inschrijven_werknemer.Models;

namespace inschrijven_werknemer.Controllers
{
    public class HomeController : LocalizationController
    {
        public ActionResult Index()
        {
            return View(new MedewerkInfoModel());
        }
    }
}

And my View looks like this

@model inschrijven_werknemer.Models.MedewerkInfoModel

<div class="stap-div" id="stap2">
    @Html.EditorForModel("MedewerkInfoModel")
</div>

What am I doing wrong?

  • 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-10T03:43:53+00:00Added an answer on June 10, 2026 at 3:43 am

    you can do something like this… using Model.IsValid property.

    So you could try this:

    [HttpPost]
    public ActionResult Index()
    {
        if (ModelState.IsValid)
        {
            return View(new MedewerkInfoModel());
        }
        return View();
    }
    

    A more detailed read is available here : https://stackoverflow.com/a/5969156/1182982 and https://stackoverflow.com/a/4760494/1182982

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

Sidebar

Related Questions

I'm new to MVC3, but so far I have managed to get along with
I'm working on a new Asp.Mvc3 application that will go line about the same
Note: I'm relatively new to MVC3. Input validation seems to be pretty nice with
I'm new to MVC3 and have been working on a small site using EF
I've been attempting to get minification and bundling working on my MVC3 project for
im working with a new ASP.NET MVC3 project and it seems like im missing
I'm building a new Asp.Net MVC3 solution and would like to have all the
My new MVC3 web application allows users to store some information about themselves, and
I am using MS Visual Studio 2010. When i create a new MVC3 project
New to MVC3 Razor - linq to sql having spent some time trying to

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.