Create New Web Pages/Views Dynamically with ASP.NET MVC 5

asp.net-mvc-5 c# entity-framework-6

Question

How would I go about creating new views/web pages dynamically in ASP.NET MVC 5? For example, I'm building an application where users sign in and submit entries, and I want the application to be able to create a new view for each new month.

I have no idea where to start with this, which part(s) of the MVC I would have to change, and how it would work.

Thank you.

1
0
9/14/2015 10:51:07 PM

Accepted Answer

You don't need to create any View dynamically, instead you need to create some Views and then render contents of those views dynamically based on Model and other available parameters.

For example you can show top entries of the month in the main page, and since top entries of the month is a query that its result vary by time, then your main view would be what you need.

Also you can change the appearance of your Created views based on model too. For example you can set background color for your main view based on the season or whatever you want.

1
9/14/2015 11:03:43 PM

Popular Answer

You can use model and one view for this and based on the month populate that view.

Look at the samples for the Model-View-Controller approach



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow