views:

19

answers:

1

We would like to use a contentPlaceHolder in our pages to set titles. What we would like to do is have the masterpage check the contentPlaceHolder to see if it has content in it. This way we can set up an e-mailer that will tell us what pages that don't have page titles since we have a fairly large site. We also have nested masterpages. Does anyone have a good way to do this?

+1  A: 

I would recommend using the pages title property. Then you would just need to check the property to determine if a title is set or not.

In my view I have this...

<%@ Page Language="C#" Title="Hello World" ... %>

And in my master page I have this...

<title><%=Page.Title%></title>

You can just check for string.IsNullOrEmpty(Page.Title) somewhere in your master page and send an email if true.

Brian