Adding View Without Model MVC 5
I need to create a simple view with 3 links to it (admin type page), I tried to add an index called View to a directory called Administration, but when I try to navigate to it, it throws up a resource that was not found. I'm new to MVC from Web Forms, so sorry if this is a stupid question;)
source to share
You need to have a controller to render the view.
For example if you have AdminController
with a method similar to something like public ActionResult Index() { return View(); }
this would render a view index
where you could place your html / links etc.
The view itself doesn't need to model
, as you don't supply anything when you return View()
.
Then you can go to the page http://xxx/Admin/Index
or, http: // xxx / Admin / '.
Worth looking around SO and other various sites for MVC requests!
Good luck.
source to share