0

How can I set the page title in asp.net mvc using strongly typed views AND a master page.

I added a public property to my master page class, but can't seem to get access to it in my view/action.

1 Answer 1

5

Setup a placeholder in the head of your master page:

<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title> 

Then in your view pages add an asp:Content section:

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server"> <%= Model.Title %> </asp:Content> 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.