[Mono-bugs] [Bug 82447][Wis] New - MasterPages / No exception thrown when using an invalid ContentPlaceHolderID attribute

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Aug 15 07:02:59 EDT 2007

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by raterus at gmail.com.


--- shadow/82447	2007-08-15 07:02:59.000000000 -0400
+++ shadow/82447.tmp.9595	2007-08-15 07:02:59.000000000 -0400
@@ -0,0 +1,54 @@
+Bug#: 82447
+Product: Mono: Class Libraries
+Version: 1.2
+OS: All
+OS Details: 
+Status: NEW   
+Priority: Wishlist
+Component: Sys.Web
+AssignedTo: mhabersack at novell.com                            
+ReportedBy: raterus at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: MasterPages / No exception thrown when using an invalid ContentPlaceHolderID attribute
+Description of Problem:
+When implementing a masterpage in a regular .aspx page, when you use a
+<asp:content ... > tag, and supply a invalid ContentPlaceholderID
+attribute, that is you supply an ID that is not used in the MasterPage,
+Mono will silently ignore this inconsistency, leaving your page to "maybe"
+throw "Object Reference not set to an instance..." exceptions, which are
+very difficult to figure out if you do not know what is going on.
+Steps to reproduce the problem:
+1.  Create an Asp.net MasterPage
+2.  Use the ASP.net MasterPage in an .aspx page
+3.  Set up an <asp:Content section, however, either misspell or change the
+casing of the underlying ContentPlaceHolderID.
+4.  Add a control, e.g. <asp:textbox ... > in the <asp:Content section you
+have made
+5.  In Page_Load (or somewhere else in code), make a quick test call to the
+<asp:textbox ... >, e.g. myTextBox.Text = "Testing"
+Actual Results:
+You will get an "Object Reference not set to an instance of an object", on
+your textbox call, however you will not be adequately warned that your
+MasterPage is set up incorrectly.
+Expected Results:
+Microsoft's framework will throw a "Cannot find ContentPlaceHolder '...' in
+the master page '...', verify content control's ContentPlaceHolderID
+attribute in the content page."
+How often does this happen? 
+Always, from what I can see
+Additional Information:
+It's a very easy fix, once you understand what is going on, however, the
+errors you get don't lead you to the problem.

More information about the mono-bugs mailing list