[Mono-bugs] [Bug 82119][Wis] New - Exception when trying to bind a boolean property in a content page

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Jul 17 10:55:35 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 g.tardini at caleidoscopio.it.

http://bugzilla.ximian.com/show_bug.cgi?id=82119

--- shadow/82119	2007-07-17 10:55:35.000000000 -0400
+++ shadow/82119.tmp.15331	2007-07-17 10:55:35.000000000 -0400
@@ -0,0 +1,75 @@
+Bug#: 82119
+Product: Mono: Class Libraries
+Version: 1.2
+OS: unknown
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Wishlist
+Component: Sys.Web
+AssignedTo: mhabersack at novell.com                            
+ReportedBy: g.tardini at caleidoscopio.it               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Exception when trying to bind a boolean property in a content page
+
+Description of Problem:
+An exception is thrown when trying to bind a boolean property of a control
+with a databinding expression in a content page. 
+
+Steps to reproduce the problem:
+1. Create an empty Master page
+2. Create a web content page (aspx) file using the master page created.
+3. Inside the content page add a control with a boolean property binded
+with a databind expression. Example:
+
+<asp:Label ID=label runat=server Enabled="<%# true %>">hello</asp:Label>
+
+I used a fixed expression (true), but you can also insert a function call.
+
+4. In the codebehind class, in the Page_Load method, call DataBind();
+
+Actual Results:
+
+An exception is thrown:
+System.InvalidCastException: Cannot cast from source type to destination type.
+  at ASP.MyPage_aspx.__BuildControl_label_DB_0 (System.Object sender,
+System.EventArgs e) [0x00000] 
+  at (wrapper delegate-invoke)
+System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
+  at System.Web.UI.Control.OnDataBinding (System.EventArgs e) [0x00000] 
+  at System.Web.UI.Control.DataBind (Boolean raiseOnDataBinding) [0x00000] 
+  at System.Web.UI.Control.DataBind () [0x00000] 
+  at System.Web.UI.Control.DataBindChildren () [0x00000] 
+  at System.Web.UI.Control.DataBind (Boolean raiseOnDataBinding) [0x00000] 
+  at System.Web.UI.Control.DataBind () [0x00000] 
+  at System.Web.UI.Control.DataBindChildren () [0x00000] 
+  at System.Web.UI.Control.DataBind (Boolean raiseOnDataBinding) [0x00000] 
+  at System.Web.UI.Control.DataBind () [0x00000] 
+  at System.Web.UI.Control.DataBindChildren () [0x00000] 
+  at System.Web.UI.Control.DataBind (Boolean raiseOnDataBinding) [0x00000] 
+  at System.Web.UI.Control.DataBind () [0x00000] 
+  at System.Web.UI.Control.DataBindChildren () [0x00000] 
+  at System.Web.UI.Control.DataBind (Boolean raiseOnDataBinding) [0x00000] 
+  at System.Web.UI.Control.DataBind () [0x00000] 
+  at MyNamespace.MyPage.Page_Load (System.Object sender, System.EventArgs
+e) [0x00000] 
+  at (wrapper delegate-invoke)
+System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
+  at System.Web.UI.Control.OnLoad (System.EventArgs e) [0x00000] 
+  at System.Web.UI.Control.LoadRecursive () [0x00000] 
+  at System.Web.UI.Page.InternalProcessRequest () [0x00000] 
+  at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context)
+[0x00000] 
+
+Expected Results:
+The page shows up with no exceptions (like in .NET does)
+
+How often does this happen? 
+Always
+
+Additional information:
+The problem seems to arise only in binding of boolean properties.


More information about the mono-bugs mailing list