Hi,
I have my asp.net mvc project setup which passes strongly typed view models to every view using a BaseViewModel. The base view model includes information such as page title & meta tag information.
Is there a fast & simple way to use this information from my ViewModel to set this information in my master page?
At the moment i have to include code such as this below in every view:
<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
<meta name="keywords" content="<%= Model.MetaKeywords %>" />
<meta name="description" content="<%= Model.MetaDescription %>" /></asp:Content>
I can't think of a way to set this info automatically other than the way i am doing it currently, but just looking to optimise this repeated html code.
Thanks! Paul