[Mono-bugs] [Bug 75682][Nor] New - Nested Repeaters fail w/ 2.0 profile / XSP2

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Aug 1 19:16:58 EDT 2005


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 mmorano at mikeandwan.us.

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

--- shadow/75682	2005-08-01 19:16:58.000000000 -0400
+++ shadow/75682.tmp.10760	2005-08-01 19:16:58.000000000 -0400
@@ -0,0 +1,293 @@
+Bug#: 75682
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.Web
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: mmorano at mikeandwan.us               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Nested Repeaters fail w/ 2.0 profile / XSP2
+
+Description of Problem:
+There appears to be a regression in the 2.0 profile for the repeater
+control (and potentially other data binding controls) in ASP.Net.  Binding
+data to a stand-alone repeater works as expected, however, if there is a
+repeater in a repeater, an exception is raised.  The sample code that
+follows runs fine in XSP, but dies in XSP2.
+
+Steps to reproduce the problem:
+1. Paste the code below into test.aspx.
+2. Start XSP2 to serve the test page you just created
+3. Access the test page in the browser.
+
+
+
+---------------------------------------------------------------
+-- BEGIN CODE
+---------------------------------------------------------------
+
+<%@ Page Language="C#" %>
+
+<script language="C#" runat="server">
+		protected override void OnInit(EventArgs e)
+        {
+            Load += new EventHandler(Page_Load);
+        }
+
+
+        private void Page_Load(object sender, EventArgs e)
+        {
+            ArrayList al = new ArrayList();
+            al.Add("One");
+            al.Add("Two");
+            al.Add("Three");
+            al.Add("Four");
+            al.Add("Five");
+
+            repeater.ItemDataBound += new RepeaterItemEventHandler(OnBound);
+            repeater.DataSource = al;
+            repeater.DataBind();
+        }
+
+
+        private void OnBound(object sender, RepeaterItemEventArgs e)
+        {
+            if(e.Item.ItemType == ListItemType.Item ||
+               e.Item.ItemType == ListItemType.AlternatingItem)
+            {
+                Literal lit = (Literal) e.Item.FindControl("lit");
+                lit.Text = e.Item.DataItem.ToString();
+
+                ArrayList al = new ArrayList();
+                al.Add("A");
+                al.Add("B");
+                al.Add("C");
+
+                Repeater nestRepeater = (Repeater)
+e.Item.FindControl("nestRepeater");
+
+                nestRepeater.ItemDataBound += new
+RepeaterItemEventHandler(OnNestBound);
+                nestRepeater.DataSource = al;
+                nestRepeater.DataBind();
+            }
+        }
+
+
+        private void OnNestBound(object sender, RepeaterItemEventArgs e)
+        {
+            if(e.Item.ItemType == ListItemType.Item ||
+               e.Item.ItemType == ListItemType.AlternatingItem)
+            {
+                Literal lit = (Literal) e.Item.FindControl("lit");
+                lit.Text = e.Item.DataItem.ToString();
+            }
+        }
+</script>
+
+
+<html>
+<body>
+
+Results:
+
+<p/>
+
+<asp:Repeater id="repeater" runat="server">
+	<HeaderTemplate>
+  		<ul>
+	</HeaderTemplate>
+
+	<ItemTemplate>
+ 		<li><asp:Literal id="lit" runat="server" />
+			<asp:Repeater id="nestRepeater" runat="server">
+ 				<HeaderTemplate>
+					<ul>
+				</HeaderTemplate>
+				<ItemTemplate>
+				 	<li><asp:Literal id="lit" runat="server" /></li>
+				</ItemTemplate>
+				<FooterTemplate>
+					</ul>
+				</FooterTemplate>
+			</asp:Repeater>
+    	</li>
+	</ItemTemplate>
+
+	<FooterTemplate>
+		</ul>
+	</FooterTemplate>
+</asp:Repeater>
+
+</body>
+</html>
+
+---------------------------------------------------------------
+-- END CODE
+---------------------------------------------------------------
+
+
+
+Actual Results:
+In XSP2:
+
+Server error in '/' application
+Description: Error processing request.
+
+Error Message: HTTP 500.
+
+Stack Trace:
+
+System.NullReferenceException: Object reference not set to an instance of
+an object
+in <0x000f8> System.Web.UI.WebControls.Repeater:GetData ()
+in <0x00014> System.Web.UI.WebControls.Repeater:GetResolvedDataSource ()
+in <0x000b0> System.Web.UI.WebControls.Repeater:CreateControlHierarchy
+(Boolean useDataSource)
+in <0x0004c> System.Web.UI.WebControls.Repeater:OnDataBinding
+(System.EventArgs e)
+in <0x00031> System.Web.UI.WebControls.Repeater:DataBind ()
+in <0x00085> System.Web.UI.Control:DataBindChildren ()
+in <0x000c9> System.Web.UI.Control:DataBind (Boolean raiseOnDataBinding)
+in <0x00020> System.Web.UI.Control:DataBind ()
+in <0x000e1> System.Web.UI.WebControls.Repeater:CreateItem (Int32
+itemIndex, ListItemType itemType, Boolean dataBind, System.Object dataItem)
+in <0x00222> System.Web.UI.WebControls.Repeater:CreateControlHierarchy
+(Boolean useDataSource)
+in <0x0004c> System.Web.UI.WebControls.Repeater:OnDataBinding
+(System.EventArgs e)
+in <0x00031> System.Web.UI.WebControls.Repeater:DataBind ()
+in <0x00104> ASP.test_aspx:Page_Load (System.Object sender, System.EventArgs e)
+in (wrapper delegate-invoke)
+System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
+in (wrapper delegate-invoke)
+System.MulticastDelegate:invoke_void_object_EventArgs (object,System.EventArgs)
+in <0x0007f> System.Web.UI.Control:OnLoad (System.EventArgs e)
+in <0x00032> System.Web.UI.Control:LoadRecursive ()
+in <0x00269> System.Web.UI.Page:InternalProcessRequest ()
+in <0x000d9> System.Web.UI.Page:ProcessRequest (System.Web.HttpContext context)
+in <0x002cc> System.Web.HttpApplication+ExecuteHandlerState:Execute ()
+in <0x000c6> System.Web.HttpApplication+StateMachine:ExecuteState
+(IStateHandler state, System.Boolean readysync)
+
+
+
+Expected Results:
+(expected results are returned in XSP, which follows)
+
+
+
+<html>
+<body>
+
+Results:
+
+<p/>
+
+
+  		<ul>
+	
+ 		<li>One
+			
+					<ul>
+				
+				 	<li>A</li>
+
+				
+				 	<li>B</li>
+				
+				 	<li>C</li>
+				
+					</ul>
+				
+    	</li>
+	
+ 		<li>Two
+			
+					<ul>
+				
+				 	<li>A</li>
+				
+				 	<li>B</li>
+
+				
+				 	<li>C</li>
+				
+					</ul>
+				
+    	</li>
+	
+ 		<li>Three
+			
+					<ul>
+				
+				 	<li>A</li>
+				
+				 	<li>B</li>
+				
+				 	<li>C</li>
+
+				
+					</ul>
+				
+    	</li>
+	
+ 		<li>Four
+			
+					<ul>
+				
+				 	<li>A</li>
+				
+				 	<li>B</li>
+				
+				 	<li>C</li>
+				
+					</ul>
+
+				
+    	</li>
+	
+ 		<li>Five
+			
+					<ul>
+				
+				 	<li>A</li>
+				
+				 	<li>B</li>
+				
+				 	<li>C</li>
+				
+					</ul>
+				
+    	</li>
+
+	
+		</ul>
+	
+
+</body>
+</html>
+
+
+
+How often does this happen? 
+
+The error always occurs in XSP2, but never occurs on XSP
+
+
+Additional Information:
+
+I am running a fresh copy of mono from svn, as of July 31, 2005.
+
+
+
+Thanks in advance!
+-Mike


More information about the mono-bugs mailing list