I have a complex model object that contains a number of child objects detailing the page status, data and configuration. The model's children are defined as base classes and are actually passed as instances of descendant classes and passed to the view to be rendered.
I have the model object being passed OK and I can create local variables that hold the data and config objects but now I want to display some values in text boxes and their labels.
Here is the variable creation in the view:
@model PageBase
@{
PageConfigPersonal config = (PageConfigPersonal)Model.PageConfig;
PageDataPersonal data = (PageDataPersonal)Model.PageData;
}
I can't figure out how, or if, Html.TextBoxFor can be used with these local variables - can this be done and if so how?
I know that I can cast the model but that is going to get really unwieldy and messy so would like to use the local variable instead.
Gordon