I am hoping for some help. I have a string value – will be coming back as Y or N. On a page I would like to convert this and display it as a readonly checkbox on the page.
I have tried
@Html.CheckboxFor( model => Convert.ToBoolean(MyString))
but it does not like that. Has anyone got any ideas how I can acheive this. Do I need to do a convert to bool on my string in my c# controller page?
Create a field on your Model that does the conversion.
CheckBoxForexpects anExpression<Func<TModel, Boolean>>because it needs to know property name based on expression.