Along with the dynamic web app pages, I would like to include a couple dozen simple - non-dynamic - html pages. Am I able to store within the ASP.net MVC folder structure within Visual Studio? If so, what is the best practice for storing these within a
project?
There's not much to it. Create a folder and add your HTML pages to the folder. The folder and files names are up to you. Use a naming convention that makes sense for your project.
Along with the dynamic web app pages, I would like to include a couple dozen simple - non-dynamic - html pages. Am I able to store within the ASP.net MVC folder structure within Visual Studio?
Of course, you can store them anywhere in your project like other static files, but for clarity, we usually create a new directory to store them. And you should reference them based on its path.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
361 Points
823 Posts
Simple html pages within MVC
Jan 31, 2020 11:22 PM|3v3rhart|LINK
Along with the dynamic web app pages, I would like to include a couple dozen simple - non-dynamic - html pages. Am I able to store within the ASP.net MVC folder structure within Visual Studio? If so, what is the best practice for storing these within a project?
All-Star
53001 Points
23587 Posts
Re: Simple html pages within MVC
Jan 31, 2020 11:41 PM|mgebhard|LINK
There's not much to it. Create a folder and add your HTML pages to the folder. The folder and files names are up to you. Use a naming convention that makes sense for your project.
Participant
1320 Points
491 Posts
Re: Simple html pages within MVC
Feb 03, 2020 07:15 AM|jiadongm|LINK
Hi 3v3rhart,
Of course, you can store them anywhere in your project like other static files, but for clarity, we usually create a new directory to store them. And you should reference them based on its path.
https://www.codeproject.com/Tips/1081630/How-to-Access-Static-Content-Files-in-MVC-Applicat
Best Regards,
Jiadong Meng
Contributor
3540 Points
918 Posts
Re: Simple html pages within MVC
Feb 03, 2020 02:20 PM|l.laxmikant|LINK
You can create a separate folder to keep your static files say folder name is "static".
Add your html files in static folder and then access it like
http://example.com/yourapplicationname/static/sample.html
http://localhost/yourapplicationname/static/sample.html