Multiple controls in MVC view that modify same model value
I have a field in my model - call it 'distance' - and I want to write a view that contains both a checkbox and a textbox. 

If the checkbox is checked, the textbox becomes disabled and 'distance' gets the value 0 when the form is submitted.

If the checkbox is not checked, 'distance' gets whatever value is in the textbox when the form is submitted.

Anybody have any guidance how to do this? It's the logic of assigning a model value based on the state of both the controls that confusing me...
Multiple controls in MVC view that modify same model value
===

I have a field in my model - call it 'distance' - and I want to write a view that contains both a checkbox and a textbox. 

If the checkbox is checked, the textbox becomes disabled and 'distance' gets the value 0 when the form is submitted.

If the checkbox is not checked, 'distance' gets whatever value is in the textbox when the form is submitted.

Anybody have any guidance how to do this? It's the logic of assigning a model value based on the state of both the controls that confusing me...