We are trying to build the form dynamically using the code that is stored in the database. Depending on what controls we want to use for a particular form, we put them in a list and pass them in our opinion.
Inside the view, we look at a list that displays code for each; however when i do the following
foreach(var control in Model.ParameterControls)
{
@control.code
}
I just get the code output in ", which displays the code itself on the screen instead of rendering the control. How to take a control, for example, @ Html.Textbox (" title ") or @ Html.DevExpress (). TextBox (" Title ") and get it to display from a variable?
Edit
ParameterControls is defined as follows
List<ControlModel> ParameterControls
Where is the ControlModel:
public string Title { get; set; }
public string ControlName { get; set; }
public ParameterType Type { get; set; }
And ParameterType:
public int TypeID { get; set; }
public string TypeName { get; set; }
public string TypeCode { get; set; }
TypeCode (..)
@Html.DevExpress().TextBox("Test").GetHtml()