I did this by just checking myContent.Controls.Count.. However, you obviously need to take into consideration any default controls that might be added.
For example, if you have your content placeholder defined as:
<asp:ContentPlaceHolder ID="myContent" runat="server">
</asp:ContentPlaceHolder>
Then you will get a LiteralControl
in the controls collection containing "\r\n" (since the line break in the definition is parsed).
So, if you remove that and define as:
<asp:ContentPlaceHolder ID="myContent" runat="server"></asp:ContentPlaceHolder>
Then you can do the check in the master page load:
if (myContent.Controls.Count > 0)
// do stuff when populated with content..
Just make sure you test the code to make sure you are actually checking for content added by the content pages, and not any default content defined in the master.
UPDATE
Following edit saying this problem is MVC-only I can confirm I am unable to replicate. I used the same code as above in an MVC app and it worked exactly as expected & described.
Can you post some sample code of what you have in place?
FYI - Here is the [working] code:
Site.Master
<asp:ContentPlaceHolder ID="myContent" runat="server"></asp:ContentPlaceHolder>
<% if (myContent.Controls.Count > 0) { %>
<b>Content Added!</b>
<% } %>
Index.aspx
<asp:Content ContentPlaceHolderID="myContent" ID="myContent" runat="server">
This will render and the "Content Added!" will also be rendered.
</asp:Content>
<%-- This will cause the "Content Added!" to be displayed but with no visual content --%>
<asp:Content ContentPlaceHolderID="myContent" ID="myContent" runat="server">
</asp:Content>
<%-- This will NOT render the "Content Added!" since there is zero content between tags --%>
<asp:Content ContentPlaceHolderID="myContent" ID="myContent" runat="server"></asp:Content>