Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 18, 2013 03:49 PM by jose.gouveia
Jan 17, 2013 05:38 PM|LINK
I have a sample webmatrix learning type application that works fine ... unit I added
So to make the header and fotter standard across all pages.
The problem is that now the PC crashes (I get the blue Screen) any time I try to run the application by selecting the "Ru" option in WebMatrix
I am hoping that this is a known problem and someone can provide assistance on how to resolve. I have Windows XP 32 bits
Jan 18, 2013 11:55 AM|LINK
Have you tried using @RenderSection instead of @RenderPage?
You can also do, in the first executed page (e.g. _SiteLayout.cshtml), define the header and footer with html tags and the body with @RenderBody, this way it also standardize the header and footer across all pages.
Jan 18, 2013 01:43 PM|LINK
The problem is from somewhere else and your code is OK. at least this part of code is OK.
Jan 18, 2013 03:12 PM|LINK
The code is fine!
According to me. The Blue Screen also shows "Dumping Physical Memory.." So that means your RAM is somehow not enough for these much processes! Or you have to close other apps and just start this one.
This would do it. And as you said in your thread you are running Windows XP. So that OS doesnot tell the user that his computer is lacking in memory. And just crashes! Windows 7 will tell you that your computer is having low memory. So try cleaning C:/ or
some other. Your code is OK!
One more thing. The RenderPage is used to tell the server to set this element here. Not to tell server to shut down PC or to restart it.
Jan 18, 2013 03:34 PM|LINK
Thanks for the information. I used the suggestion from Jose and this to work fine.
Only question I have is the following:
In the _siteLayout.cshtml I have the following
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css\LOBemail.css" />
<img src="img\AnImage.jpg" alt="eee"></img>
<a href ="httpAlink">The Link</a> Contact List
In _PageStart.cshtml I have this:
So how WebMatrix know from these two that I want to lunch MySite.cshtml by just pointing to the @RenderBody()?
Thanks for the help
Jan 18, 2013 03:38 PM|LINK
No no the RendorBody is for setting the element here.
You can see header is in top. Footer in bottom. The files are in MySite.cshtml They are loaded here. Every code is placed in the RendorBody thing. And the header and footer are loaded above and below the MySite.cshtml code respectively.
WebMatrix is told because of the
Layout = "~/_SiteLayout.cshtml"; // Or what ever the Layout file you are using..
Jan 18, 2013 03:49 PM|LINK
= "~/_SiteLayout.cshtml";} is all you need in your page because what it does is embed all the current page (where you are
referencing the Layout) inside the _SiteLayout.cshtml in the @RenderBody zone.