[Mono-bugs] [Bug 82352][Nor] New - ASP.Net - HyperLinkField can't bind from an integer field

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Aug 7 10:02:14 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.

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

--- shadow/82352	2007-08-07 10:02:14.000000000 -0400
+++ shadow/82352.tmp.8450	2007-08-07 10:02:14.000000000 -0400
@@ -0,0 +1,96 @@
+Bug#: 82352
+Product: Mono: Runtime
+Version: 1.2
+OS: other
+OS Details: CentOS 4.5
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: JIT
+AssignedTo: lupus at ximian.com                            
+ReportedBy: raterus at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: ASP.Net - HyperLinkField can't bind from an integer field
+
+Description of Problem:
+
+When I attempt to databind a HyperLinkField in a Gridview (ASP.Net 2.0),
+and I'm using the "datanavigateurlfields" and "datanavigateurlformatstring"
+properties, if the underlying datasource column is an integer column, the
+binding will fail.
+
+Steps to reproduce the problem:
+1.  Create an ASP.Net 2.0 page, that uses a GridView, and a HyperLinkColumn
+2.  Set the datanavigateurlformatstring to
+"./test.aspx?testid={0}"
+3.  Set the datanavigateurlfields="testid", where testid is an integer
+field from your datasource (I was using a datatable as my datasource) 
+
+Actual Results:
+Server Error in '/' Application
+Object reference not set to an instance of an object
+
+Description: Error processing request.
+
+Error Message: HTTP 500. System.NullReferenceException: Object reference
+not set to an instance of an object
+
+Stack Trace:
+
+System.NullReferenceException: Object reference not set to an instance of
+an object
+  at System.Web.UI.WebControls.HyperLinkField.OnDataBindField
+(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.WebControls.GridView.CreateChildControls (IEnumerable
+data, Boolean dataBinding) [0x00000] 
+  at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding
+(IEnumerable data) [0x00000] 
+  at System.Web.UI.WebControls.GridView.PerformDataBinding (IEnumerable
+data) [0x00000] 
+  at System.Web.UI.WebControls.DataBoundControl.OnSelect (IEnumerable data)
+[0x00000] 
+  at (wrapper delegate-invoke)
+System.MulticastDelegate:invoke_void_IEnumerable
+(System.Collections.IEnumerable)
+  at System.Web.UI.DataSourceView.Select
+(System.Web.UI.DataSourceSelectArguments selectArgs,
+System.Web.UI.DataSourceViewSelectCallback callBack) [0x00000] 
+  at System.Web.UI.WebControls.DataBoundControl.PerformSelect () [0x00000] 
+  at System.Web.UI.WebControls.BaseDataBoundControl.DataBind () [0x00000] 
+  at System.Web.UI.WebControls.GridView.DataBind () [0x00000] 
+  at Test_TestError.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 GridView should successfully display, it does display successfully on
+the Microsoft .Net Framework
+
+
+How often does this happen? 
+Always
+
+Additional Information:
+If the underlying datatype is a string, the field will bind successfully. 
+Something with the data conversion in the HyperLinkField is failing.
+
+Workaround:
+Ensure the underlying datatype of the column is of character data, not integer.


More information about the mono-bugs mailing list