Re: [BUG]Value from checkbox do not handle as parameter

MaineOne is right. If you look at your form's action attribute "product/update" that is the URL that will be invoked. If you want the checkbox state to be passed in the URL I think you'll need some javascript to put it there right before the form submits,
possibly using the onsubmit event of the form.

Otherwise, just use what MaineOne said in the server side and remove that action parameter.

Re: [BUG]Value from checkbox do not handle as parameter

That doesn't matter for the problem if not getting the value as a parameter to the action method. I was assuming you had a POST there anyway. With POST in your form you will be able to verify the checkbox presence using the Request.Form["checkbox_name"].

To get the checkbox state passed as a method parameter I still think you will need to put it in the form's action before posting.

Re: [BUG]Value from checkbox do not handle as parameter

The conversion error is because you're trying to convert the default checkbox value of "on" or "off" to a boolean. To get this to work, you need to set a value on the checkbox of "1" or "true" and then do some testing to make sure it's been selected:

Re: [BUG]Value from checkbox do not handle as parameter

I have strong opinion that Controller MUST NOT acceess Request.Form anyway this is interface.

I have controller with simple and testable signature. I write controller and than view not the contrary

publicvoid Step2(
string Name, int Age, bool
skip_step )

and want be possible provide fields from html form to this controller.

in signature above int field succesfull provided to controller ( except cases when not int values entered - this interesting case too, but about it later. )
and chackebox i think must be converted to bool (i think it very logical =)) )

Re: [BUG]Value from checkbox do not handle as parameter

mogadanez

I have controller with simple and testable signature. I write controller and than view not the contrary

I think the issue here is whether you use GET or POST. In this case, for testing, you can mock the Request.Form collection as needed. I'd like to keep this thread on-topic, if you want to move this discussion to a new thread that would help.

Re: [BUG]Value from checkbox do not handle as parameter

robconery

I think the issue here is whether you use GET or POST. In this case, for testing, you can mock the Request.Form collection as needed. I'd like to keep this thread on-topic, if you want to move this discussion to a new thread that would help.

Yes i can, but not want. this way increase complexity both tests and code. Also this create hidden dependecies. I agree that this can be moved to new thread. I will enjoy in this topic. But not for me. I Just want to MVC Framework be best framework after
final release. [;)]