I'm trying to validate my login form, but the "ModelState.IsValid" function is not performing validation.
Accordingtotheaboveimage,whenexecutingAction,the"MakeLoginViewModel" parameter is being passed as "null". Below is the content of my ViewModel.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using HolisticWeb.Models;
using System.ComponentModel.DataAnnotations;
namespace HolisticWeb.ViewModel
{
public class EfetuarLoginViewModel
{
public EfetuarLoginViewModel()
{
Login = String.Empty;
Senha = String.Empty;
}
[Display(Name = "Nome de Usuário")]
[Required(ErrorMessage = "Informe seu Login")]
public string Login { get; set; }
[Display(Name = "Senha")]
[Required(ErrorMessage = "Informe sua Senha")]
[DataType(DataType.Password)]
public string Senha { get; set; }
}
}