Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorMarek Habersack <grendel@twistedcode.net>2010-04-13 02:41:45 +0400
committerMarek Habersack <grendel@twistedcode.net>2010-04-13 02:41:45 +0400
commit39e3e0830c3ec7fd51771fd220288817f2cdb8c9 (patch)
tree0dc424540a420059abd34919c52f255d56391553 /mcs
parent2cd378f8e30a461ef8ec9a672ccaf77bfe382abf (diff)
Backport of r155270
svn path=/branches/mono-2-6/mcs/; revision=155271
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/System.Web/Makefile11
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog6
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxField.cs27
-rw-r--r--mcs/class/System.Web/System.Web.UI.WebControls/ImageField.cs36
-rw-r--r--mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog4
-rw-r--r--mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxFieldTest.cs181
-rw-r--r--mcs/class/System.Web/Test/mainsoft/NunitWebResources/App_Code/CustomCheckBoxColumn.cs118
-rw-r--r--mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_0.aspx35
-rw-r--r--mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_1.aspx35
-rw-r--r--mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_2.aspx35
-rw-r--r--mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_5.aspx35
-rw-r--r--mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_6.aspx35
-rw-r--r--mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_7.aspx35
13 files changed, 570 insertions, 23 deletions
diff --git a/mcs/class/System.Web/Makefile b/mcs/class/System.Web/Makefile
index 1d7a2e93060..d06991b6001 100644
--- a/mcs/class/System.Web/Makefile
+++ b/mcs/class/System.Web/Makefile
@@ -76,7 +76,8 @@ RESOURCE_FILES_2 = \
OTHER_RES = $(RESOURCE_FILES_1)
TEST_APP_CODE_FILES = \
Test/mainsoft/NunitWebResources/App_Code/EnumConverterControl.cs \
- Test/mainsoft/NunitWebResources/App_Code/MyContainer.cs
+ Test/mainsoft/NunitWebResources/App_Code/MyContainer.cs \
+ Test/mainsoft/NunitWebResources/App_Code/CustomCheckBoxColumn.cs
TEST_APP_GLOBALRESOURCES_FILES = \
Test/mainsoft/NunitWebResources/App_GlobalResources/Common.resx \
@@ -216,7 +217,13 @@ TEST_RESOURCE_FILES = \
Test/mainsoft/NunitWebResources/SqlDataSource_OnInit_Bug572781.aspx \
Test/mainsoft/NunitWebResources/FormViewPagerVisibility.aspx \
Test/mainsoft/NunitWebResources/OverridenControlsPropertyAndPostBack_Bug594238.aspx \
- Test/mainsoft/NunitWebResources/GlobalizationEncodingName.aspx
+ Test/mainsoft/NunitWebResources/GlobalizationEncodingName.aspx \
+ Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_0.aspx \
+ Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_1.aspx \
+ Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_2.aspx \
+ Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_5.aspx \
+ Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_6.aspx \
+ Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_7.aspx
RESX_DIST = resources/TranslationResources.resx
ifneq (1, $(FRAMEWORK_VERSION_MAJOR))
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
index 75f4e87f251..7e5c23e2bb2 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
@@ -1,3 +1,9 @@
+2010-04-13 Marek Habersack <mhabersack@novell.com>
+
+ * ImageField.cs, CheckBoxField.cs: OnDataBindField must expect
+ sender to be something else than DataControlFieldCell. Fixes bug
+ #595568
+
2010-04-07 Marek Habersack <mhabersack@novell.com>
* FormParameter.cs, CookieParameter.cs, ProfileParameter.cs,
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxField.cs b/mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxField.cs
index 696728bd174..b7faf08a560 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxField.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/CheckBoxField.cs
@@ -121,9 +121,24 @@ namespace System.Web.UI.WebControls {
protected override void OnDataBindField (object sender, EventArgs e)
{
try {
- DataControlFieldCell cell = (DataControlFieldCell) sender;
- CheckBox box = (CheckBox) cell.Controls [0];
- object val = GetValue (cell.BindingContainer);
+ Control container = (Control) sender;
+ object val = GetValue (container.NamingContainer);
+ CheckBox box = sender as CheckBox;
+ if (box == null) {
+ DataControlFieldCell cell = sender as DataControlFieldCell;
+ if (cell != null) {
+ ControlCollection controls = cell.Controls;
+ int ccount = controls != null ? controls.Count : 0;
+ if (ccount == 1)
+ box = controls [0] as CheckBox;
+ if (box == null)
+ return;
+ }
+ }
+
+ if (box == null)
+ throw new HttpException ("CheckBox field '" + DataField + "' contains a control that isn't a CheckBox. Override OnDataBindField to inherit from CheckBoxField and add different controls.");
+
if (val != null && val != DBNull.Value)
box.Checked = (bool) val;
else
@@ -134,11 +149,9 @@ namespace System.Web.UI.WebControls {
if (!box.Visible)
box.Visible = true;
- }
- catch (HttpException) {
+ } catch (HttpException) {
throw;
- }
- catch (Exception ex) {
+ } catch (Exception ex) {
throw new HttpException (ex.Message, ex);
}
}
diff --git a/mcs/class/System.Web/System.Web.UI.WebControls/ImageField.cs b/mcs/class/System.Web/System.Web.UI.WebControls/ImageField.cs
index 1a53061ca94..7513feafd01 100644
--- a/mcs/class/System.Web/System.Web.UI.WebControls/ImageField.cs
+++ b/mcs/class/System.Web/System.Web.UI.WebControls/ImageField.cs
@@ -285,10 +285,15 @@ namespace System.Web.UI.WebControls {
PropertyDescriptor GetProperty (Control controlContainer, string fieldName)
{
+ if (fieldName == ThisExpression)
+ return null;
+
IDataItemContainer dic = (IDataItemContainer) controlContainer;
- PropertyDescriptor prop = TypeDescriptor.GetProperties (dic.DataItem) [fieldName];
+ PropertyDescriptorCollection properties = TypeDescriptor.GetProperties (dic.DataItem);
+ PropertyDescriptor prop = properties != null ? properties [fieldName] : null;
if (prop == null)
throw new InvalidOperationException ("Property '" + fieldName + "' not found in object of type " + dic.DataItem.GetType());
+
return prop;
}
@@ -299,34 +304,41 @@ namespace System.Web.UI.WebControls {
protected virtual void OnDataBindField (object sender, EventArgs e)
{
- DataControlFieldCell cell = (DataControlFieldCell) sender;
-
- if (cell.Controls.Count == 0)
+ Control control = (Control) sender;
+ ControlCollection controls = control != null ? control.Controls : null;
+ Control namingContainer = control.NamingContainer;
+ Control c;
+ if (sender is DataControlFieldCell) {
+ if (controls.Count == 0)
+ return;
+ c = controls [0];
+ } else if (sender is Image || sender is TextBox)
+ c = control;
+ else
return;
-
+
if (imageProperty == null)
- imageProperty = GetProperty (cell.BindingContainer, DataImageUrlField);
+ imageProperty = GetProperty (namingContainer, DataImageUrlField);
- Control c = cell.Controls [0];
if (c is TextBox) {
- object val = GetValue (cell.BindingContainer, DataImageUrlField, ref imageProperty);
- ((TextBox)c).Text = val != null ? val.ToString() : "";
+ object val = GetValue (namingContainer, DataImageUrlField, ref imageProperty);
+ ((TextBox)c).Text = val != null ? val.ToString() : String.Empty;
}
else if (c is Image) {
Image img = (Image)c;
- string value = FormatImageUrlValue (GetValue (cell.BindingContainer, DataImageUrlField, ref imageProperty));
+ string value = FormatImageUrlValue (GetValue (namingContainer, DataImageUrlField, ref imageProperty));
if (value == null || (ConvertEmptyStringToNull && value.Length == 0)) {
if (NullImageUrl == null || NullImageUrl.Length == 0) {
c.Visible = false;
Label label = new Label ();
label.Text = NullDisplayText;
- cell.Controls.Add (label);
+ controls.Add (label);
}
else
value = NullImageUrl;
}
img.ImageUrl = value;
- img.AlternateText = GetFormattedAlternateText (cell.BindingContainer);
+ img.AlternateText = GetFormattedAlternateText (namingContainer);
}
}
diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
index c5020716e02..d0c837f717b 100644
--- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
+++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
@@ -1,3 +1,7 @@
+2010-04-13 Marek Habersack <mhabersack@novell.com>
+
+ * CheckBoxFieldTest.cs: added test for bug #595568
+
2010-04-01 Marek Habersack <mhabersack@novell.com>
* FormViewTest.cs: added test for bug #578863
diff --git a/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxFieldTest.cs b/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxFieldTest.cs
index 2ab402da6ba..955a3665b96 100644
--- a/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxFieldTest.cs
+++ b/mcs/class/System.Web/Test/System.Web.UI.WebControls/CheckBoxFieldTest.cs
@@ -43,8 +43,8 @@ using System.Collections.Specialized;
using NUnit.Framework;
using System.Data;
-
-
+using MonoTests.SystemWeb.Framework;
+using MonoTests.stand_alone.WebHarness;
namespace MonoTests.System.Web.UI.WebControls
{
@@ -114,6 +114,183 @@ namespace MonoTests.System.Web.UI.WebControls
public const string WRONGFIELD = "str";
public static int databound;
+ [TestFixtureSetUp]
+ public void SetUp ()
+ {
+ WebTest.CopyResource (GetType (), "CheckBoxField_Bug595568_0.aspx", "CheckBoxField_Bug595568_0.aspx");
+ WebTest.CopyResource (GetType (), "CheckBoxField_Bug595568_1.aspx", "CheckBoxField_Bug595568_1.aspx");
+ WebTest.CopyResource (GetType (), "CheckBoxField_Bug595568_2.aspx", "CheckBoxField_Bug595568_2.aspx");
+ WebTest.CopyResource (GetType (), "CheckBoxField_Bug595568_5.aspx", "CheckBoxField_Bug595568_5.aspx");
+ WebTest.CopyResource (GetType (), "CheckBoxField_Bug595568_6.aspx", "CheckBoxField_Bug595568_6.aspx");
+ WebTest.CopyResource (GetType (), "CheckBoxField_Bug595568_7.aspx", "CheckBoxField_Bug595568_7.aspx");
+ }
+
+ [Test (Description="Bug 595568 #0")]
+ public void CheckBoxField_Bug595568_0 ()
+ {
+ string originalHtml = @"<div>
+ <table id=""gridView"" cellspacing=""0"" rules=""all"" border=""1"" style=""border-collapse:collapse;"">
+ <tr>
+ <th scope=""col"">&nbsp;</th>
+ </tr><tr>
+ <td><span title=""Dummy""><input id=""gridView_ctl02_ctl00"" type=""checkbox"" name=""gridView$ctl02$ctl00"" checked=""checked"" /></span></td>
+ </tr><tr>
+ <td><span title=""Dummy""><input id=""gridView_ctl03_ctl00"" type=""checkbox"" name=""gridView$ctl03$ctl00"" /></span></td>
+ </tr><tr>
+ <td><span title=""Dummy""><input id=""gridView_ctl04_ctl00"" type=""checkbox"" name=""gridView$ctl04$ctl00"" /></span></td>
+ </tr>
+ </table>
+ </div>";
+ WebTest t = new WebTest ("CheckBoxField_Bug595568_0.aspx");
+ string pageHtml = t.Run ();
+ string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
+
+ HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
+ }
+
+ [Test (Description="Bug 595568 #1")]
+ public void CheckBoxField_Bug595568_1 ()
+ {
+ string originalHtml = @"<div>
+ <table id=""gridView"" cellspacing=""0"" rules=""all"" border=""1"" style=""border-collapse:collapse;"">
+ <tr>
+ <th scope=""col"">&nbsp;</th>
+ </tr><tr>
+ <td><select size=""4"">
+
+ </select><span title=""Dummy""><input id=""gridView_ctl02_ctl01"" type=""checkbox"" name=""gridView$ctl02$ctl01"" checked=""checked"" /></span></td>
+ </tr><tr>
+ <td><select size=""4"">
+
+ </select><span title=""Dummy""><input id=""gridView_ctl03_ctl01"" type=""checkbox"" name=""gridView$ctl03$ctl01"" /></span></td>
+ </tr><tr>
+ <td><select size=""4"">
+
+ </select><span title=""Dummy""><input id=""gridView_ctl04_ctl01"" type=""checkbox"" name=""gridView$ctl04$ctl01"" /></span></td>
+ </tr>
+ </table>
+ </div>";
+ WebTest t = new WebTest ("CheckBoxField_Bug595568_1.aspx");
+ string pageHtml = t.Run ();
+ string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
+
+ HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
+ }
+
+ [Test (Description="Bug 595568 #2")]
+ public void CheckBoxField_Bug595568_2 ()
+ {
+ string originalHtml = @"<div>
+ <table id=""gridView"" cellspacing=""0"" rules=""all"" border=""1"" style=""border-collapse:collapse;"">
+ <tr>
+ <th scope=""col"">&nbsp;</th>
+ </tr><tr>
+ <td><input id=""gridView_ctl02_ctl00"" type=""checkbox"" name=""gridView$ctl02$ctl00"" /><span title=""Dummy""><input id=""gridView_ctl02_ctl01"" type=""checkbox"" name=""gridView$ctl02$ctl01"" checked=""checked"" /></span><input id=""gridView_ctl02_ctl02"" type=""checkbox"" name=""gridView$ctl02$ctl02"" /></td>
+ </tr><tr>
+ <td><input id=""gridView_ctl03_ctl00"" type=""checkbox"" name=""gridView$ctl03$ctl00"" /><span title=""Dummy""><input id=""gridView_ctl03_ctl01"" type=""checkbox"" name=""gridView$ctl03$ctl01"" /></span><input id=""gridView_ctl03_ctl02"" type=""checkbox"" name=""gridView$ctl03$ctl02"" /></td>
+ </tr><tr>
+ <td><input id=""gridView_ctl04_ctl00"" type=""checkbox"" name=""gridView$ctl04$ctl00"" /><span title=""Dummy""><input id=""gridView_ctl04_ctl01"" type=""checkbox"" name=""gridView$ctl04$ctl01"" /></span><input id=""gridView_ctl04_ctl02"" type=""checkbox"" name=""gridView$ctl04$ctl02"" /></td>
+ </tr>
+ </table>
+ </div>";
+
+ WebTest t = new WebTest ("CheckBoxField_Bug595568_2.aspx");
+ string pageHtml = t.Run ();
+ string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
+
+ HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
+ }
+
+ [Test (Description="Bug 595568 #5")]
+ public void CheckBoxField_Bug595568_5 ()
+ {
+ string originalHtml = @"<div>
+ <table id=""gridView"" cellspacing=""0"" rules=""all"" border=""1"" style=""border-collapse:collapse;"">
+ <tr>
+ <th scope=""col"">&nbsp;</th>
+ </tr><tr>
+ <td><select size=""4"">
+
+ </select></td>
+ </tr><tr>
+ <td><select size=""4"">
+
+ </select></td>
+ </tr><tr>
+ <td><select size=""4"">
+
+ </select></td>
+ </tr>
+ </table>
+ </div>";
+
+ WebTest t = new WebTest ("CheckBoxField_Bug595568_5.aspx");
+ string pageHtml = t.Run ();
+ string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
+
+ HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
+ }
+
+ [Test (Description="Bug 595568 #6")]
+ public void CheckBoxField_Bug595568_6 ()
+ {
+ string originalHtml = @"<div>
+ <table id=""gridView"" cellspacing=""0"" rules=""all"" border=""1"" style=""border-collapse:collapse;"">
+ <tr>
+ <th scope=""col"">&nbsp;</th>
+ </tr><tr>
+ <td><select size=""4"">
+
+ </select><input id=""gridView_ctl02_ctl01"" type=""checkbox"" name=""gridView$ctl02$ctl01"" /></td>
+ </tr><tr>
+ <td><select size=""4"">
+
+ </select><input id=""gridView_ctl03_ctl01"" type=""checkbox"" name=""gridView$ctl03$ctl01"" /></td>
+ </tr><tr>
+ <td><select size=""4"">
+
+ </select><input id=""gridView_ctl04_ctl01"" type=""checkbox"" name=""gridView$ctl04$ctl01"" /></td>
+ </tr>
+ </table>
+ </div>";
+
+ WebTest t = new WebTest ("CheckBoxField_Bug595568_6.aspx");
+ string pageHtml = t.Run ();
+ string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
+
+ HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
+ }
+
+ [Test (Description="Bug 595568 #7")]
+ public void CheckBoxField_Bug595568_7 ()
+ {
+ string originalHtml = @"<div>
+ <table id=""gridView"" cellspacing=""0"" rules=""all"" border=""1"" style=""border-collapse:collapse;"">
+ <tr>
+ <th scope=""col"">&nbsp;</th>
+ </tr><tr>
+ <td><input id=""gridView_ctl02_ctl00"" type=""checkbox"" name=""gridView$ctl02$ctl00"" /><select size=""4"">
+
+ </select></td>
+ </tr><tr>
+ <td><input id=""gridView_ctl03_ctl00"" type=""checkbox"" name=""gridView$ctl03$ctl00"" /><select size=""4"">
+
+ </select></td>
+ </tr><tr>
+ <td><input id=""gridView_ctl04_ctl00"" type=""checkbox"" name=""gridView$ctl04$ctl00"" /><select size=""4"">
+
+ </select></td>
+ </tr>
+ </table>
+ </div>";
+
+ WebTest t = new WebTest ("CheckBoxField_Bug595568_7.aspx");
+ string pageHtml = t.Run ();
+ string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
+
+ HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
+ }
+
[Test]
public void CheckBoxField_DefaultProperty ()
{
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/App_Code/CustomCheckBoxColumn.cs b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/App_Code/CustomCheckBoxColumn.cs
new file mode 100644
index 00000000000..9c5ba12edc3
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/App_Code/CustomCheckBoxColumn.cs
@@ -0,0 +1,118 @@
+using System;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace Tests
+{
+ public class CustomCheckBoxColumn : CheckBoxField
+ {
+ string caseId;
+
+ public CustomCheckBoxColumn (string id)
+ {
+ this.caseId = id;
+ }
+
+ protected override void InitializeDataCell(DataControlFieldCell cell, DataControlRowState rowState)
+ {
+ switch (caseId) {
+ default:
+ case "0":
+ Case0 (cell);
+ break;
+
+ case "1":
+ Case1 (cell);
+ break;
+
+ case "2":
+ Case2 (cell);
+ break;
+
+ case "3":
+ Case3 (cell);
+ break;
+
+ case "4":
+ Case4 (cell);
+ break;
+
+ case "5":
+ Case5 (cell);
+ break;
+
+ case "6":
+ Case6 (cell);
+ break;
+
+ case "7":
+ Case7 (cell);
+ break;
+ }
+ }
+
+ void Case0 (DataControlFieldCell cell)
+ {
+ CheckBox checkBox = new CheckBox();
+ checkBox.ToolTip = "Dummy";
+ cell.Controls.Add(checkBox);
+ checkBox.DataBinding += OnDataBindField;
+ }
+
+ void Case1 (DataControlFieldCell cell)
+ {
+ ListBox lb = new ListBox ();
+ cell.Controls.Add(lb);
+ Case0 (cell);
+ }
+
+ void Case2 (DataControlFieldCell cell)
+ {
+ cell.Controls.Add(new CheckBox ());
+ Case0 (cell);
+ cell.Controls.Add(new CheckBox ());
+ }
+
+ void Case3 (DataControlFieldCell cell)
+ {
+ Content content = new Content ();
+
+ CheckBox checkBox = new CheckBox();
+ checkBox.ToolTip = "Dummy";
+ content.Controls.Add(checkBox);
+ checkBox.DataBinding += OnDataBindField;
+
+ cell.Controls.Add (content);
+ }
+
+ void Case4 (DataControlFieldCell cell)
+ {
+ CheckBox checkBox = new CheckBox();
+ checkBox.ToolTip = "Dummy";
+ cell.Controls.Add(checkBox);
+
+ ListBox lb = new ListBox ();
+ lb.DataBinding += OnDataBindField;
+ cell.Controls.Add(lb);
+ }
+
+ void Case5 (DataControlFieldCell cell)
+ {
+ cell.Controls.Add (new ListBox ());
+ }
+
+ void Case6 (DataControlFieldCell cell)
+ {
+ cell.Controls.Add (new ListBox ());
+ cell.Controls.Add (new CheckBox ());
+ }
+
+ void Case7 (DataControlFieldCell cell)
+ {
+ cell.Controls.Add (new CheckBox ());
+ cell.Controls.Add (new ListBox ());
+ }
+ }
+}
+
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_0.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_0.aspx
new file mode 100644
index 00000000000..67d0e1d6419
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_0.aspx
@@ -0,0 +1,35 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyPage" %>
+<%@ Import Namespace="Tests" %>
+
+<script runat="server">
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (IsPostBack) return;
+
+ bool[] ba = new bool [3];
+ ba [0] = true;
+ gridView.DataSource = ba;
+ gridView.DataBind();
+ }
+
+ protected void OnGridViewInit(object sender, EventArgs e)
+ {
+ CustomCheckBoxColumn column = new CustomCheckBoxColumn("0");
+ column.DataField = "!";
+ gridView.Columns.Add(column);
+ }
+</script>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head runat="server">
+ <title></title>
+</head>
+<body>
+ <form id="form1" method="GET" runat="server">
+ <div>
+ <%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %><asp:GridView runat="server" ID="gridView" OnInit="OnGridViewInit" AutoGenerateColumns="False" /><%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
+ </div>
+ </form>
+</body>
+</html>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_1.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_1.aspx
new file mode 100644
index 00000000000..37c965eea11
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_1.aspx
@@ -0,0 +1,35 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyPage" %>
+<%@ Import Namespace="Tests" %>
+
+<script runat="server">
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (IsPostBack) return;
+
+ bool[] ba = new bool [3];
+ ba [0] = true;
+ gridView.DataSource = ba;
+ gridView.DataBind();
+ }
+
+ protected void OnGridViewInit(object sender, EventArgs e)
+ {
+ CustomCheckBoxColumn column = new CustomCheckBoxColumn("1");
+ column.DataField = "!";
+ gridView.Columns.Add(column);
+ }
+</script>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head runat="server">
+ <title></title>
+</head>
+<body>
+ <form id="form1" method="GET" runat="server">
+ <div>
+ <%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %><asp:GridView runat="server" ID="gridView" OnInit="OnGridViewInit" AutoGenerateColumns="False" /><%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
+ </div>
+ </form>
+</body>
+</html>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_2.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_2.aspx
new file mode 100644
index 00000000000..e477f9a0ffa
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_2.aspx
@@ -0,0 +1,35 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyPage" %>
+<%@ Import Namespace="Tests" %>
+
+<script runat="server">
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (IsPostBack) return;
+
+ bool[] ba = new bool [3];
+ ba [0] = true;
+ gridView.DataSource = ba;
+ gridView.DataBind();
+ }
+
+ protected void OnGridViewInit(object sender, EventArgs e)
+ {
+ CustomCheckBoxColumn column = new CustomCheckBoxColumn("2");
+ column.DataField = "!";
+ gridView.Columns.Add(column);
+ }
+</script>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head runat="server">
+ <title></title>
+</head>
+<body>
+ <form id="form1" method="GET" runat="server">
+ <div>
+ <%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %><asp:GridView runat="server" ID="gridView" OnInit="OnGridViewInit" AutoGenerateColumns="False" /><%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
+ </div>
+ </form>
+</body>
+</html>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_5.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_5.aspx
new file mode 100644
index 00000000000..ce7567d5e20
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_5.aspx
@@ -0,0 +1,35 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyPage" %>
+<%@ Import Namespace="Tests" %>
+
+<script runat="server">
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (IsPostBack) return;
+
+ bool[] ba = new bool [3];
+ ba [0] = true;
+ gridView.DataSource = ba;
+ gridView.DataBind();
+ }
+
+ protected void OnGridViewInit(object sender, EventArgs e)
+ {
+ CustomCheckBoxColumn column = new CustomCheckBoxColumn("5");
+ column.DataField = "!";
+ gridView.Columns.Add(column);
+ }
+</script>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head runat="server">
+ <title></title>
+</head>
+<body>
+ <form id="form1" method="GET" runat="server">
+ <div>
+ <%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %><asp:GridView runat="server" ID="gridView" OnInit="OnGridViewInit" AutoGenerateColumns="False" /><%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
+ </div>
+ </form>
+</body>
+</html>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_6.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_6.aspx
new file mode 100644
index 00000000000..c9c93e9cdf4
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_6.aspx
@@ -0,0 +1,35 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyPage" %>
+<%@ Import Namespace="Tests" %>
+
+<script runat="server">
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (IsPostBack) return;
+
+ bool[] ba = new bool [3];
+ ba [0] = true;
+ gridView.DataSource = ba;
+ gridView.DataBind();
+ }
+
+ protected void OnGridViewInit(object sender, EventArgs e)
+ {
+ CustomCheckBoxColumn column = new CustomCheckBoxColumn("6");
+ column.DataField = "!";
+ gridView.Columns.Add(column);
+ }
+</script>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head runat="server">
+ <title></title>
+</head>
+<body>
+ <form id="form1" method="GET" runat="server">
+ <div>
+ <%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %><asp:GridView runat="server" ID="gridView" OnInit="OnGridViewInit" AutoGenerateColumns="False" /><%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
+ </div>
+ </form>
+</body>
+</html>
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_7.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_7.aspx
new file mode 100644
index 00000000000..8461ee7f2cf
--- /dev/null
+++ b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/CheckBoxField_Bug595568_7.aspx
@@ -0,0 +1,35 @@
+<%@ Page Language="C#" AutoEventWireup="true" CodeFile="MyPage.aspx.cs" Inherits="MyPage" %>
+<%@ Import Namespace="Tests" %>
+
+<script runat="server">
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ if (IsPostBack) return;
+
+ bool[] ba = new bool [3];
+ ba [0] = true;
+ gridView.DataSource = ba;
+ gridView.DataBind();
+ }
+
+ protected void OnGridViewInit(object sender, EventArgs e)
+ {
+ CustomCheckBoxColumn column = new CustomCheckBoxColumn("7");
+ column.DataField = "!";
+ gridView.Columns.Add(column);
+ }
+</script>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head runat="server">
+ <title></title>
+</head>
+<body>
+ <form id="form1" method="GET" runat="server">
+ <div>
+ <%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %><asp:GridView runat="server" ID="gridView" OnInit="OnGridViewInit" AutoGenerateColumns="False" /><%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
+ </div>
+ </form>
+</body>
+</html>