Wednesday, August 13, 2008

Meta Information in .Net (aspx) Websites Using Master Pages

If you are having problems adding meta information to your .Net (aspx) website using master pages, try this:
Add these lines of code to your master page right under the <title> line:
<asp:contentplaceholder id="headerPlaceHolder" runat="server">
</asp:contentplaceholder>

Then each new page you create will have a section for you to add the meta information to. Then add these two lines to each "headerPlaceHolder":
<meta name="description" content="Your website description should go here.">
<meta name="keywords" content="keywords that describe your website should go here">

Now you'll be able to update the meta information for each of your web pages even if you're using master pages.

No comments: