Can anyone tell me i am using Umbraco BeginForm and Input type CheckBox
when i am select the checkbox then ModelState is Arrives False, and when i am not selection checkbox then ModelState Become true.
Current Umbraco Version is 10.5.1 and i am using Surface Controller and BeginUmbracoForm.
I will provide you full detail.
@using (Html.BeginUmbracoForm
@Html.CheckBoxFor(model => model.RememberMe)
}
this is my form when User Login.
This is my Surface Controller.
public class LoginInfo
{
[Required]
public string Email { get; set; }
[Required]
public string Password { get; set; }
public bool RememberMe { get; set; }
}
this is Model class
Now Issue is that when User Checkon RememberMe Box then in the Model state arriving Everytime False and when User Don't select Checkbox
then Model state Arriving true but every time value arriving False.
I have tried So many resorces but I am not getting answer.
Umbraco BeginForm Input tag
Can anyone tell me i am using Umbraco BeginForm and Input type CheckBox when i am select the checkbox then ModelState is Arrives False, and when i am not selection checkbox then ModelState Become true.
Here i attached code
public bool RememberMe { get; set; }
Can anyone help me?
Hi Tejas,
Could you provide some more detail please.
What is the exact version of Umbraco you are using?
Are you posting to a SurfaceController?
Hi Huw,
Current Umbraco Version is 10.5.1 and i am using Surface Controller and BeginUmbracoForm.
I will provide you full detail.
@using (Html.BeginUmbracoForm
This is my Surface Controller.
public class LoginInfo { [Required] public string Email { get; set; } [Required] public string Password { get; set; } public bool RememberMe { get; set; } } this is Model class
Now Issue is that when User Checkon RememberMe Box then in the Model state arriving Everytime False and when User Don't select Checkbox then Model state Arriving true but every time value arriving False.
I have tried So many resorces but I am not getting answer.
Can you please help me.
Thanks in Advance.
Unfortunately you code is a bit mangled so I am not able to see it correctly
is working on a reply...