[Mono-bugs] [Bug 48060][Maj] New - Control\ Repeater Data Bind bug

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 31 Aug 2003 04:33:34 -0400 (EDT)


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 yaronsh@mainsoft.com.

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

--- shadow/48060	2003-08-31 04:33:34.000000000 -0400
+++ shadow/48060.tmp.13325	2003-08-31 04:33:34.000000000 -0400
@@ -0,0 +1,97 @@
+Bug#: 48060
+Product: Mono/Class Libraries
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: System.Web
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: yaronsh@mainsoft.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Control\ Repeater Data Bind bug
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+
+
+Steps to reproduce the problem:
+1. Open the attached aspx file.
+2. Set a table named "Products" in a DB named "store" at SQL server.
+   (With a column named "ModelName" with some strings of a models names).
+3. Set the connection string to your server. (line 11 at WebForm1.aspx    
+   html, server=<YOUR SERVER>).
+4. Run the aspx file.
+5. Click the "Fill" button
+
+Actual Results:
+An empty repeater is displayed.
+
+Expected Results:
+A repeater with the model names from the "Products" table should be 
+displayed.
+
+How often does this happen? 
+Always.
+
+Additional Information:
+As far as I saw Repeater.DataBind() call to it's own OnDataBinding and 
+not it's base like MS.
+It seems like the columns are not created and InitializeCell is not 
+called.
+When the control want to call the columns DataBind delgates there is 
+null reference. (No one registered).
+However, reading xml into DataSet works.
+Mention, that this testcase was tested with MS ASP.NET and worked.
+
+<%@ Page language="c#" AutoEventWireup="false" %>
+<%@ Import Namespace="System.Data.SqlClient" %>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
+<HTML>
+  <HEAD>
+       <script language=C# runat=server>
+       private void BtnFill_Click(object sender, System.EventArgs e)
+       {
+	   SqlConnection connection = new SqlConnection
+	      ("server=rafim-2k;User Id=sa;Password=;database=store");
+
+	   try 
+	   {
+		connection.Open (); 
+		SqlCommand command = new SqlCommand
+	    	     ("select * from Products", connection);
+
+		SqlDataReader reader = command.ExecuteReader ();
+				
+		//Connect and Bind
+		productList.DataSource = reader;
+		productList.DataBind ();
+	   }
+	   finally 
+	   {
+	        connection.Close ();
+	   }
+       }
+       </script>
+    </HEAD>
+    <body MS_POSITIONING="GridLayout">
+	<form id="Form1" method="post" runat="server">
+	    <asp:Repeater ID="productList" runat="server">
+		<ItemTemplate>
+		   <asp:HyperLink Text='<%#DataBinder.Eval 
+                       (Container.DataItem, "ModelName")%>' runat="server" 
+                       ID="Hyperlink1" NAME="Hyperlink1"/>
+		</ItemTemplate>
+	    </asp:Repeater>
+	    <asp:Button id=BtnFill OnClick="BtnFill_Click" style="Z-INDEX: 
+                        101; LEFT: 176px; POSITION: absolute; TOP: 216px" 
+                        runat="server" Text="Fill"></asp:Button>
+	</form>
+     </body>
+</HTML>