0
I am trying to validate my login form, but the "Modelstate.Isvalid" function is not performing the validation.
According to the image above, when executing Action, the "Effectwindmodel" parameter is being passed as "null". Below is the contents 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; }
}
}
How’s your url? it’s a structure similar to this http://localhost:50339/Dashboard/Viewmodel? Login="Meulogin"
– user31040