Last post Feb 25, 2018 12:02 AM by bruce (sqlwork.com)
Feb 24, 2018 03:40 PM|andrewcw|LINK
Just started trying MVC/MVVM. My modifed version from VS2017 seems to work fine - and comes up as
( http://localhost:62850/) .
But once I leave VS environment I dont know how to launch it ...
If I publish the site ( using folder ) to a test web server under a folder ( call it IPV) I see lots of folders.. but I dont see any index.html etc
What is the address of the site ?,,, I am using the true folder address,,,,, but there's no index.html....
There are some folders with views with .cshtml and just as an experiment tried ( none worked )
.....Ipv/Views/ipv/IPV.cshtml ( should have been my starting view )
Also tried ... Ipv/Views/ipv/home/index.cshtml
Whats the key here ?? Does simply calling http;//companyTestserver/FolderPaths/IPV supposed to engage the site ? I tried that and nothing happened just said it could not display the directory,
Note : the page where I hoped to start ..
Layout = "~/Views/Shared/_Layout.cshtml";
<table class="table table-condensed table-bordered table-striped table-hover">
I noticed from the Getting sstarted pages that Razor pages should start with @page but none of the views with .cshtml start with @page
Also noticed (
https://docs.microsoft.com/en-us/aspnet/core/mvc/razor-pages/?tabs=visual-studio ) that the discussion on URL and file location maps to Pages/index.cshtml
But the MVC ( and I am still on Windows 7 for 2 more months so not using .CORE for development ) doesnt have pages folders rather VIEWS... but that will still suggest that the IIS must be configured to recognize IPV as a site .... Is that correct ? I
cannot load it as folder in an existing site and call it like other HTML pages ?
Feb 24, 2018 06:02 PM|andrewcw|LINK
OK I think I answered own question, On another server where I can set up IIS sites I did that & published & oy works simply by using IPV. I tried inserting an image from my computer but insert image must only work with website ?:
Feb 25, 2018 12:02 AM|bruce (sqlwork.com)|LINK
views are code and can not be accessed as a file. in MVC you call action, which are mapped to url by routes. if you start with the default MVC project, the default is /home/index. the full address depends on how the site is installed in IIS. the site must
be added as asp.net application, and appall setup for it. if was added as application ipv, then:
all go the same place. home controller, index action.