I just got a couple questions about asp.net mvc 3.
I was reading about layouts with razor .
So the article I think is from like preview 1 and I am using the final version of 3.0.
When I make a 3.0 project and look at _Layout.cshtml it has
<title>@ViewBag.Title</title>
What is ViewBag? I heard it is like equivalent to ViewData.
If what I heard is right why are they using it like this? In the article I listed they used
<title>@View.Title </title>
So is the above obsolete or is it a different way of doing it?
With _ViewStart.cshtml if you put one of these in the shared folder and then one in the home views folder. The one in the home views one will trump the shared one?
Can you have _ViewStart.cshtml in the shared folder?
In the aspx engine you had master pages with content tags. @Sections seem to be the equivalent to it. However if you only need one content tag(ie for the body) you just use @RenderBody?
Is @RenderPage used for loading partial views or is it used for something different?
What is the difference from using @RenderSection Optional and just not putting anything between the content tags if you were using the aspx engine?
What happens if you want the stuff in the @RenderSection to stored in a partial view. Can you still make it optional?
not specific to asp.net mvc 3
- Is there a 3rd party library has have more html helpers?
Thanks