I want to test if the checkbox is checked or not from my action method, what i need is to pass checkbox value from view to controller.
This is my view:
You should be strongly typing your views. Then you can do this:
public class YourViewModel {
public bool ConditionaValue { get; set; }
}
In your view, you can create a checkbox that will bind to this boolean value:
@Html.CheckBoxFor(x => x.ConditionalValue)
If it is checked, the model property will be true.
For your immediate problem though.. you need to name your checkbox to be the same name as your action method parameters.. and they should be bool
..