MVC 3 + Razor + Areas (Cannot call layout page)

 
55   93.9
Jul 21, 2011
 
Hi Team,

Can any one had experience with MVC 3+ Razor + Areas?
I do not get the layout page when I access Areas view pages.. Can anyone help me in this?
I am good with routing and I can access view page inside Areas but it is not showing the ayout page (Masterpage)

Arul



630   99.9
Jul 22, 2011
Arul:

Here is what you need:  Include the _ViewStart.cshtml file in the Views folder for the Area.
In fact, if you have a global layout, you should add this file to each Area.

Hope this helps.
Dan.

 

1,284   100.0
Jul 23, 2011
 1 comment
 
Hi Thanks for this link, but using this link I have had Go to Home link for all the pages using partialrender Menu.cshtml still I had issue with my master layout is not calling Area view . If you have any sample code for using both Area and Initial login. Initial login is coming correctly when I will click area view link clik that time master layout disapprearing. Thanks. --- Arul Kalivarathan  Jul 25, 2011

548   99.9
Jul 24, 2011
Do as Dan suggests and also add your own _layout.cshtml file.  If you have different Areas that will display content differently, it's good to have one _layout.cshtml for each Area.

Also, if you are using VS 2010, you should definitely make sure you are using the latest Tools Update for Visual Studio.  This changes the "Add" dialogs to include many new features including HTML5 stuff.

I hope this helps.
 1 comment
 
Hi Thanks for your reply, do you have any sample code for the above example, it would be more helpfull for me. my id is arulkg@yahoo.com , thanks for your help. --- Arul Kalivarathan  Jul 25, 2011