thetipsyhacker
thetipsyhacker

Reputation: 1422

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

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.

Upvotes: 1

Views: 1803

Answers (2)

Reza Aghaei
Reza Aghaei

Reputation: 125197

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.

Upvotes: 1

eric_eri
eric_eri

Reputation: 709

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

Upvotes: 1

Related Questions