I have existing ASP.NET MVC View pages and View user controls which I currently use in normal straightforward ASP.NET MVC fashion, sometimes I use RenderPartialView or RenderAction, etc.
By themselves they include tag. I would like to dynamically load either Views or ViewUserControl based on the selection in a dropdown list.
I’m having trouble deciding should I remove from Views and controls and put it just into the one View that will do dynamic rendering or to leave it there and leave outside of the .
What do you think and how would you go about it?
You can use JQuery to get the HTML from your Partial views and substitute it in the div. It could be something like this:
I did it this way and it works.
/Controller/Actioncan be a partial view which returns HTML.