I am using the twitter bootstrap framework, so to get the EditorFor and DisplayFor methods to output what I need, I created custom templates for each of the types like string, t
You have to initialize your RememberMe
bool value
inside the constructor as shown below.
Remember that using uninitialized variables in C# is not allowed.
using System.ComponentModel;
public class ClassName
{
public ClassName ()
{
RememberMe = false;
}
[DefaultValue(false)]
[Display(Name = "Remember me?")]
public bool RememberMe { get; set; }
}
For more infromation check Default Values Table
I hope this will help to you.