简体   繁体   中英

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM