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.
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.
Please "Marks As Answer" if any answer helped you out!
~~! FIREWALL !~~
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..
}
Please "Marks As Answer" if any answer helped you out!
~~! FIREWALL !~~
The @{Layout="~/_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.
jscriptor09
Member
5 Points
11 Posts
@RenderPage razor tag crahes the pc
Jan 17, 2013 05:38 PM|LINK
Hello
I have a sample webmatrix learning type application that works fine ... unit I added
@RenderPage("PageHeader.cshtml")
@RenderPage("PageFooter.cshtml")
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
Thanks
Mike
jose.gouveia
Member
205 Points
68 Posts
Re: @RenderPage razor tag crahes the pc
Jan 18, 2013 11:55 AM|LINK
Hello Mike,
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.
........<div id="body">saeed_saedva...
Member
408 Points
74 Posts
Re: @RenderPage razor tag crahes the pc
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.
Saeed Saedvand
Afzaal.Ahmad...
Contributor
2660 Points
1039 Posts
Re: @RenderPage razor tag crahes the pc
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.
~~! FIREWALL !~~
jscriptor09
Member
5 Points
11 Posts
Re: @RenderPage razor tag crahes the pc
Jan 18, 2013 03:34 PM|LINK
Hello folks
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
In _PageStart.cshtml I have this:@{Layout="~/_siteLayout.cshtml";
}
So how WebMatrix know from these two that I want to lunch MySite.cshtml by just pointing to the @RenderBody()?
Thanks for the help
Mike
Afzaal.Ahmad...
Contributor
2660 Points
1039 Posts
Re: @RenderPage razor tag crahes the pc
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.. }~~! FIREWALL !~~
jose.gouveia
Member
205 Points
68 Posts
Re: @RenderPage razor tag crahes the pc
Jan 18, 2013 03:49 PM|LINK
Mike,
The @{Layout = "~/_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.
HTH,
Jose.