1

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
  • 2
    Unless there is something that I am misunderstanding, you will likely be much better off if you do not attempt to create new web pages/views dynamically -- but instead create a single view that can dynamically render the proper output for whichever month is desired. Commented Sep 14, 2015 at 22:56

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.