So this is the view :
div class="row">
<div class="col-md-6" style="width:auto">
@foreach (var module in Model)
{
if (module.Placeholder == "left" && module.PageId == "contact" && module.Control == "Tabelar2")
{
Html.RenderAction("Tabelar2", "ContentHtml", module.Control );
}
<br />
}
</div>
I have a field in the database Control that saves names of controls/actionresults/views , example
module.Control
shows 3 words(actionresults/views names) from database , NewsList and Tabelar and Tabelar2.
In the above code , i say manually , but how can i do it to , if :
if (module.Control == "Tabelar2") //tabelar2 is just a text , but in fact the name of an actionresult in the controller
{
Html.RenderAction("Tabelar2", "ContentHtml", module.Control );
}
So , based on module.control , then render that control and recognise it as actionresult/view , exmaple NewsList.chtml , and render this view inside the div.
What I have tried:
i just explained above the question.