Question: I am newbie for ASP.NET MVC 1.0. I am converting from a classic application built up with VS2008 .NET3.5. I created a master page, and the menu must be read from the database. Now the code that generate the HTML into the appropriate menu div in classic ASP.NET3.5 VS2008 was in the code behind of the master page.

I cannot understand now where the code beind of the master page is in ASP.NET MVC 1.0?

Anyone has examples?

Thanks

Answer: 
You can still have code behind if you want. In your .master file put:

```
<%@ Master Language="C#" AutoEventWireup="true" 
Inherits="Site_Master" CodeFile="Site.Master.cs" %>

```

Then in your .master.cs:

```
public partial class Site_Master : ViewMasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
}

```
Your master page is now a View, and Views should be passive. In other words, they shouldn't go look up things themselves.

It would be a much more correct approach (within the context of ASP.NET MVC) to pull the required data from the Model.

Take a look at [this SO question](https://stackoverflow.com/questions/1320516/asp-net-mvc-view-with-masterpage-binding-with-different-models/1320656#1320656) for a related discussion.