You don't need to copy that line in your _Layout.cshtml file, just move the file to ~/Views/Shared/ folder and modify path to it in _ViewStart.cshtml (If you wish to keep original _Layout.cshtml file, just put the new one in some folder or rename it).
Very good tutorial, I'm sure the MVC community will appreciate it.
For the advanced users though, I would recommend putting the template in Content but not creating layout.cshtml in the same folder, instead leave it on Shared as it is. Just change the content of Layout.cshtml to the content in index.html and make the appropriate changes in the HTML code to point to the CSS and images.
This because it would kill the spirit of MVC to put it in the Content folder rather than leaving it at View.
I am trying to do something similar as what you did in this video but with using VB.Net, instead of C and there was not something like _layout.cshtml, instead I changed Site.Master and that worked. There are a few minor difference, but I think people will manage to find the differences.
You don't need to copy that line in your _Layout.cshtml file, just move the file to ~/Views/Shared/ folder and modify path to it in _ViewStart.cshtml (If you wish to keep original _Layout.cshtml file, just put the new one in some folder or rename it).
nikgor86 3 weeks ago
Very good video Thanks
tecsined 1 month ago
NIce I liked this idea and I am going to try this Thanks so much
richardlipp21 2 months ago
This has been flagged as spam show
Hi! Could you guys please check out my channel? I will do a giveaway when I reach 100 subscribers! Thanks!
hackster2011 2 months ago
in my _Layout.cshtml I have not found:
@inhertis System.Web.Mvc.WebViewPage
what should I do ??
menyarito1 4 months ago
@menyarito1 Did anybody ever answer you on this question? I have the same issue.. :(
RAFTERMANCOLO 1 month ago
Great, thank you very much
menyarito1 4 months ago
thank you very much.....
raktky 4 months ago
Thanks for this video. It helped me change the default look of my site in ASP.NET MVC.
fabiogia 6 months ago
This has been flagged as spam show
Thanks for the video.
BielAcer 6 months ago
Very good tutorial, I'm sure the MVC community will appreciate it.
For the advanced users though, I would recommend putting the template in Content but not creating layout.cshtml in the same folder, instead leave it on Shared as it is. Just change the content of Layout.cshtml to the content in index.html and make the appropriate changes in the HTML code to point to the CSS and images.
This because it would kill the spirit of MVC to put it in the Content folder rather than leaving it at View.
bolshevik2 9 months ago 4
Thank you very much..
devamuthukumaran 10 months ago
Thanks for the great video.
jsc0 11 months ago
You can also use Views/ViewStart.cshtml file to put the
Layout = "~/Views/Shared/_Layout.cshtml"; once and for all so dont need to change
each page like this
jakkamma 1 year ago
hey thanks... this was great! The new Razor engine just keeps giving back!
HookaMega 1 year ago
ASP.NET MVC 3 Beta now has support for VB. There are vbhtml counterparts for every cshtml files, so this should be really easy now.
dmchitnis 1 year ago
I am trying to do something similar as what you did in this video but with using VB.Net, instead of C and there was not something like _layout.cshtml, instead I changed Site.Master and that worked. There are a few minor difference, but I think people will manage to find the differences.
jandirks 1 year ago