Quellcode durchsuchen

In System.Web.UI:
2006-02-23 Chris Toshok <[email protected]>

* Page.cs (ProcessCallbackData): track change to
ICallbackEventHandler iface.

* ICallbackEventHandler.cs: enable the proper members of this
interface.

* DataSourceSelectArguments.cs: reformat getter/setters.

In System.Web.UI.WebControls:
2006-02-23 Chris Toshok <[email protected]>

* BaseCompareValidator.cs, BaseValidator.cs, Button.cs,
DataControlField.cs, DetailsView.cs, FormView.cs, GridView.cs,
HotSpot.cs, LinkButton.cs, Login.cs, SiteMapDataSource.cs,
SqlDataSourceCommandType.cs, TableSectionStyle.cs,
TemplateField.cs, TreeNodeCollection.cs, TreeNode.cs, TreeView.cs,
ValidationSummary.cs, WizardStepBase.cs: fix tons of corcompare
errors. most were caused by a property/method being virtual when
it shouldn't be, or vice versa.


svn path=/trunk/mcs/; revision=57203

Chris Toshok vor 20 Jahren
Ursprung
Commit
5cb4398967
24 geänderte Dateien mit 717 neuen und 608 gelöschten Zeilen
  1. 6 1
      mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs
  2. 19 4
      mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs
  3. 5 14
      mcs/class/System.Web/System.Web.UI.WebControls/Button.cs
  4. 11 0
      mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
  5. 4 4
      mcs/class/System.Web/System.Web.UI.WebControls/DataControlField.cs
  6. 168 144
      mcs/class/System.Web/System.Web.UI.WebControls/DetailsView.cs
  7. 155 149
      mcs/class/System.Web/System.Web.UI.WebControls/FormView.cs
  8. 163 140
      mcs/class/System.Web/System.Web.UI.WebControls/GridView.cs
  9. 28 27
      mcs/class/System.Web/System.Web.UI.WebControls/HotSpot.cs
  10. 4 10
      mcs/class/System.Web/System.Web.UI.WebControls/LinkButton.cs
  11. 9 9
      mcs/class/System.Web/System.Web.UI.WebControls/Login.cs
  12. 17 17
      mcs/class/System.Web/System.Web.UI.WebControls/SiteMapDataSource.cs
  13. 2 2
      mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceCommandType.cs
  14. 1 1
      mcs/class/System.Web/System.Web.UI.WebControls/TableSectionStyle.cs
  15. 14 14
      mcs/class/System.Web/System.Web.UI.WebControls/TemplateField.cs
  16. 48 23
      mcs/class/System.Web/System.Web.UI.WebControls/TreeNode.cs
  17. 6 6
      mcs/class/System.Web/System.Web.UI.WebControls/TreeNodeCollection.cs
  18. 27 15
      mcs/class/System.Web/System.Web.UI.WebControls/TreeView.cs
  19. 1 1
      mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs
  20. 11 11
      mcs/class/System.Web/System.Web.UI.WebControls/WizardStepBase.cs
  21. 10 0
      mcs/class/System.Web/System.Web.UI/ChangeLog
  22. 4 12
      mcs/class/System.Web/System.Web.UI/DataSourceSelectArguments.cs
  23. 2 3
      mcs/class/System.Web/System.Web.UI/ICallbackEventHandler.cs
  24. 2 1
      mcs/class/System.Web/System.Web.UI/Page.cs

+ 6 - 1
mcs/class/System.Web/System.Web.UI.WebControls/BaseCompareValidator.cs

@@ -41,7 +41,12 @@ namespace System.Web.UI.WebControls {
 
 		ValidationDataType type;
 
-		public BaseCompareValidator ()
+#if NET_2_0
+		protected
+#else
+		public
+#endif
+		BaseCompareValidator ()
 		{
 			type = ValidationDataType.String;
 		}

+ 19 - 4
mcs/class/System.Web/System.Web.UI.WebControls/BaseValidator.cs

@@ -71,7 +71,7 @@ namespace System.Web.UI.WebControls {
 #if NET_2_0
 		[Themeable (false)]
 		[DefaultValue ("")]
-		public string ValidationGroup {
+		public virtual string ValidationGroup {
 			get { return ViewState.GetString ("ValidationGroup", String.Empty); }
 			set { ViewState["ValidationGroup"] = value; }
 		}
@@ -146,7 +146,12 @@ namespace System.Web.UI.WebControls {
 		[DefaultValue("")]
 		[WebSysDescription ("")]
 		[WebCategory ("Appearance")]
-		public virtual string ErrorMessage {
+#if NET_2_0
+		public
+#else
+		public virtual
+#endif
+		string ErrorMessage {
 			get { return ViewState.GetString ("ErrorMessage", String.Empty); }
 			set { ViewState ["ErrorMessage"] = value; }
 		}
@@ -168,7 +173,12 @@ namespace System.Web.UI.WebControls {
 		[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
 		[WebSysDescription ("")]
 		[WebCategory ("Misc")]
-		public virtual bool IsValid {
+#if NET_2_0
+		public
+#else
+		public virtual
+#endif
+		bool IsValid {
 			get { return valid; }
 			set { valid = value; }
 		}
@@ -482,7 +492,12 @@ namespace System.Web.UI.WebControls {
 		}
 
 		/* the docs say "public sealed" here */
-		public virtual void Validate ()
+#if NET_2_0
+		public
+#else
+		public virtual
+#endif
+		void Validate ()
 		{
 			if (Enabled && Visible)
 				IsValid = ControlPropertiesValid () && EvaluateIsValid ();

+ 5 - 14
mcs/class/System.Web/System.Web.UI.WebControls/Button.cs

@@ -89,11 +89,8 @@ namespace System.Web.UI.WebControls {
 		[WebCategory ("Behavior")]
 #if NET_2_0
 		[Themeable (false)]
-		public virtual
-#else		
-		public
 #endif		
-		string CommandArgument {
+		public string CommandArgument {
 			get {
 				return ViewState.GetString ("CommandArgument", "");
 			}
@@ -107,11 +104,8 @@ namespace System.Web.UI.WebControls {
 		[WebCategory ("Behavior")]
 #if NET_2_0
 		[Themeable (false)]
-		public virtual
-#else
-		public
 #endif		
-		string CommandName {
+		public string CommandName {
 			get {
 				return ViewState.GetString ("CommandName", "");
 			}
@@ -144,11 +138,8 @@ namespace System.Web.UI.WebControls {
 		[WebCategory ("Appearance")]
 #if NET_2_0
 		[Localizable (true)]
-		public virtual
-#else		
-		public
 #endif		
-		string Text {
+		public string Text {
 			get {
 				return ViewState.GetString ("Text", "");
 			}
@@ -292,7 +283,7 @@ namespace System.Web.UI.WebControls {
 		[Themeable (false)]
 		[UrlProperty("*.aspx")]
 		[MonoTODO]
-		public string PostBackUrl {
+		public virtual string PostBackUrl {
 			get {
 				throw new NotImplementedException ();
 			}
@@ -305,7 +296,7 @@ namespace System.Web.UI.WebControls {
 		[Themeable (false)]
 		[WebSysDescription ("")]
 		[WebCategoryAttribute ("Behavior")]
-		public string ValidationGroup {
+		public virtual string ValidationGroup {
 			get {
 				return ViewState.GetString ("ValidationGroup", "");
 			}

+ 11 - 0
mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog

@@ -1,3 +1,14 @@
+2006-02-23  Chris Toshok  <[email protected]>
+
+	* BaseCompareValidator.cs, BaseValidator.cs, Button.cs,
+	DataControlField.cs, DetailsView.cs, FormView.cs, GridView.cs,
+	HotSpot.cs, LinkButton.cs, Login.cs, SiteMapDataSource.cs,
+	SqlDataSourceCommandType.cs, TableSectionStyle.cs,
+	TemplateField.cs, TreeNodeCollection.cs, TreeNode.cs, TreeView.cs,
+	ValidationSummary.cs, WizardStepBase.cs: fix tons of corcompare
+	errors.  most were caused by a property/method being virtual when
+	it shouldn't be, or vice versa.
+
 2006-02-22  Chris Toshok  <[email protected]>
 
 	* ObjectDataSource.cs: corcompare work.

+ 4 - 4
mcs/class/System.Web/System.Web.UI.WebControls/DataControlField.cs

@@ -223,7 +223,7 @@ namespace System.Web.UI.WebControls {
 		[PersistenceModeAttribute (PersistenceMode.InnerProperty)]
 		[DefaultValueAttribute (null)]
 		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Content)]
-		public virtual Style ControlStyle {
+		public Style ControlStyle {
 			get {
 				if (controlStyle == null) {
 					controlStyle = new Style ();
@@ -242,7 +242,7 @@ namespace System.Web.UI.WebControls {
 		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Content)]
 		[PersistenceModeAttribute (PersistenceMode.InnerProperty)]
 		[WebCategoryAttribute ("Styles")]
-		public virtual TableItemStyle FooterStyle {
+		public TableItemStyle FooterStyle {
 			get {
 				if (footerStyle == null) {
 					footerStyle = new TableItemStyle ();
@@ -286,7 +286,7 @@ namespace System.Web.UI.WebControls {
 		[WebCategoryAttribute ("Styles")]
 		[PersistenceModeAttribute (PersistenceMode.InnerProperty)]
 		[DefaultValueAttribute (null)]
-		public virtual TableItemStyle HeaderStyle {
+		public TableItemStyle HeaderStyle {
 			get {
 				if (headerStyle == null) {
 					headerStyle = new TableItemStyle ();
@@ -328,7 +328,7 @@ namespace System.Web.UI.WebControls {
 		[PersistenceModeAttribute (PersistenceMode.InnerProperty)]
 		[WebCategoryAttribute ("Styles")]
 		[DefaultValueAttribute (null)]
-		public virtual TableItemStyle ItemStyle {
+		public TableItemStyle ItemStyle {
 			get {
 				if (itemStyle == null) {
 					itemStyle = new TableItemStyle ();

+ 168 - 144
mcs/class/System.Web/System.Web.UI.WebControls/DetailsView.cs

@@ -40,13 +40,14 @@ using System.Reflection;
 
 namespace System.Web.UI.WebControls
 {
+	[SupportsEventValidation]
 	[ToolboxDataAttribute ("<{0}:DetailsView runat=\"server\" Width=\"125px\" Height=\"50px\"></{0}:DetailsView>")]
 	[DesignerAttribute ("System.Web.UI.Design.WebControls.DetailsViewDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
 	[ControlValuePropertyAttribute ("SelectedValue")]
 	[DefaultEventAttribute ("PageIndexChanging")]
 	[AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public class DetailsView: CompositeDataBoundControl, ICallbackEventHandler, ICallbackContainer, IDataItemContainer, INamingContainer
+	public class DetailsView: CompositeDataBoundControl, ICallbackEventHandler, ICallbackContainer, IDataItemContainer, INamingContainer, IPostBackEventHandler, IPostBackContainer
 	{
 		object dataItem;
 		
@@ -272,7 +273,7 @@ namespace System.Web.UI.WebControls
 		
 		[WebCategoryAttribute ("Paging")]
 		[DefaultValueAttribute (false)]
-		public bool AllowPaging {
+		public virtual bool AllowPaging {
 			get {
 				object ob = ViewState ["AllowPaging"];
 				if (ob != null) return (bool) ob;
@@ -285,11 +286,11 @@ namespace System.Web.UI.WebControls
 		}
 		
 		[DefaultValueAttribute (null)]
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle AlternatingRowStyle {
+		public TableItemStyle AlternatingRowStyle {
 			get {
 				if (alternatingRowStyle == null) {
 					alternatingRowStyle = new TableItemStyle ();
@@ -384,7 +385,7 @@ namespace System.Web.UI.WebControls
 		[WebCategoryAttribute ("Accessibility")]
 		[DefaultValueAttribute ("")]
 		[LocalizableAttribute (true)]
-		public string Caption {
+		public virtual string Caption {
 			get {
 				object ob = ViewState ["Caption"];
 				if (ob != null) return (string) ob;
@@ -442,11 +443,11 @@ namespace System.Web.UI.WebControls
 		}
 		
 		[DefaultValueAttribute (null)]
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle CommandRowStyle {
+		public TableItemStyle CommandRowStyle {
 			get {
 				if (commandRowStyle == null) {
 					commandRowStyle = new TableItemStyle ();
@@ -457,16 +458,16 @@ namespace System.Web.UI.WebControls
 			}
 		}
 
-	    [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-	    [BrowsableAttribute (false)]
+		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
+		[BrowsableAttribute (false)]
 		public DetailsViewMode CurrentMode {
 			get {
 				return currentMode;
 			}
 		}
 	
-	    [DefaultValueAttribute (DetailsViewMode.ReadOnly)]
-	    [WebCategoryAttribute ("Behavior")]
+		[DefaultValueAttribute (DetailsViewMode.ReadOnly)]
+		[WebCategoryAttribute ("Behavior")]
 		public virtual DetailsViewMode DefaultMode {
 			get {
 				object o = ViewState ["DefaultMode"];
@@ -522,12 +523,12 @@ namespace System.Web.UI.WebControls
 			}
 		}
 
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-	    [DefaultValueAttribute (null)]
-		public virtual TableItemStyle EditRowStyle {
+		[DefaultValueAttribute (null)]
+		public TableItemStyle EditRowStyle {
 			get {
 				if (editRowStyle == null) {
 					editRowStyle = new TableItemStyle ();
@@ -538,12 +539,12 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-	    [DefaultValueAttribute (null)]
-		public virtual TableItemStyle EmptyDataRowStyle {
+		[DefaultValueAttribute (null)]
+		public TableItemStyle EmptyDataRowStyle {
 			get {
 				if (emptyDataRowStyle == null) {
 					emptyDataRowStyle = new TableItemStyle ();
@@ -557,8 +558,8 @@ namespace System.Web.UI.WebControls
 		[DefaultValue (null)]
 		[TemplateContainer (typeof(DetailsView), BindingDirection.OneWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate EmptyDataTemplate {
+		[Browsable (false)]
+		public virtual ITemplate EmptyDataTemplate {
 			get { return emptyDataTemplate; }
 			set { emptyDataTemplate = value; RequireBinding (); }
 		}
@@ -592,12 +593,12 @@ namespace System.Web.UI.WebControls
 			}
 		}
 	
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DefaultValue (null)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle FieldHeaderStyle {
+		public TableItemStyle FieldHeaderStyle {
 			get {
 				if (fieldHeaderStyle == null) {
 					fieldHeaderStyle = new TableItemStyle ();
@@ -620,16 +621,16 @@ namespace System.Web.UI.WebControls
 		[DefaultValue (null)]
 		[TemplateContainer (typeof(DetailsView), BindingDirection.OneWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate FooterTemplate {
+		[Browsable (false)]
+		public virtual ITemplate FooterTemplate {
 			get { return footerTemplate; }
 			set { footerTemplate = value; RequireBinding (); }
 		}
 
-	    [LocalizableAttribute (true)]
-	    [WebCategoryAttribute ("Appearance")]
-	    [DefaultValueAttribute ("")]
-		public string FooterText {
+		[LocalizableAttribute (true)]
+		[WebCategoryAttribute ("Appearance")]
+		[DefaultValueAttribute ("")]
+		public virtual string FooterText {
 			get {
 				object ob = ViewState ["FooterText"];
 				if (ob != null) return (string) ob;
@@ -641,12 +642,12 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DefaultValue (null)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle FooterStyle {
+		public TableItemStyle FooterStyle {
 			get {
 				if (footerStyle == null) {
 					footerStyle = new TableItemStyle ();
@@ -679,12 +680,12 @@ namespace System.Web.UI.WebControls
 			}
 		}
 	
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DefaultValue (null)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle HeaderStyle {
+		public TableItemStyle HeaderStyle {
 			get {
 				if (headerStyle == null) {
 					headerStyle = new TableItemStyle ();
@@ -698,16 +699,16 @@ namespace System.Web.UI.WebControls
 		[DefaultValue (null)]
 		[TemplateContainer (typeof(DetailsView), BindingDirection.OneWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate HeaderTemplate {
+		[Browsable (false)]
+		public virtual ITemplate HeaderTemplate {
 			get { return headerTemplate; }
 			set { headerTemplate = value; RequireBinding (); }
 		}
 
-	    [LocalizableAttribute (true)]
-	    [WebCategoryAttribute ("Appearance")]
-	    [DefaultValueAttribute ("")]
-		public string HeaderText {
+		[LocalizableAttribute (true)]
+		[WebCategoryAttribute ("Appearance")]
+		[DefaultValueAttribute ("")]
+		public virtual string HeaderText {
 			get {
 				object ob = ViewState ["HeaderText"];
 				if (ob != null) return (string) ob;
@@ -733,12 +734,12 @@ namespace System.Web.UI.WebControls
 			}
 		}
 
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-	    [DefaultValueAttribute (null)]
-		public virtual TableItemStyle InsertRowStyle {
+		[DefaultValueAttribute (null)]
+		public TableItemStyle InsertRowStyle {
 			get {
 				if (insertRowStyle == null) {
 					insertRowStyle = new TableItemStyle ();
@@ -751,7 +752,7 @@ namespace System.Web.UI.WebControls
 		
 		[BrowsableAttribute (false)]
 		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-		public int PageCount {
+		public virtual int PageCount {
 			get {
 				if (pageCount != -1) return pageCount;
 				EnsureDataBound ();
@@ -760,9 +761,9 @@ namespace System.Web.UI.WebControls
 		}
 
 		[WebCategoryAttribute ("Paging")]
-	    [BindableAttribute (true, BindingDirection.OneWay)]
+		[BindableAttribute (true, BindingDirection.OneWay)]
 		[DefaultValueAttribute (0)]
-		public int PageIndex {
+		public virtual int PageIndex {
 			get {
 				return pageIndex;
 			}
@@ -776,7 +777,7 @@ namespace System.Web.UI.WebControls
 		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Content)]
 		[NotifyParentPropertyAttribute (true)]
 		[PersistenceModeAttribute (PersistenceMode.InnerProperty)]
-		public PagerSettings PagerSettings {
+		public virtual PagerSettings PagerSettings {
 			get {
 				if (pagerSettings == null) {
 					pagerSettings = new PagerSettings (this);
@@ -787,11 +788,11 @@ namespace System.Web.UI.WebControls
 			}
 		}
 	
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle PagerStyle {
+		public TableItemStyle PagerStyle {
 			get {
 				if (pagerStyle == null) {
 					pagerStyle = new TableItemStyle ();
@@ -807,8 +808,8 @@ namespace System.Web.UI.WebControls
 		/* DataControlPagerCell isnt specified in the docs */
 		//[TemplateContainer (typeof(DataControlPagerCell), BindingDirection.OneWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate PagerTemplate {
+		[Browsable (false)]
+		public virtual ITemplate PagerTemplate {
 			get { return pagerTemplate; }
 			set { pagerTemplate = value; RequireBinding (); }
 		}
@@ -822,12 +823,12 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
 		[DefaultValue (null)]
-		public virtual TableItemStyle RowStyle {
+		public TableItemStyle RowStyle {
 			get {
 				if (rowStyle == null) {
 					rowStyle = new TableItemStyle ();
@@ -838,9 +839,9 @@ namespace System.Web.UI.WebControls
 			}
 		}
 
-	    [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
+		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
 		[BrowsableAttribute (false)]
-		public virtual object SelectedValue {
+		public object SelectedValue {
 			get { return DataKey.Value; }
 		}
 		
@@ -855,7 +856,7 @@ namespace System.Web.UI.WebControls
 	
 		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
 		[BrowsableAttribute (false)]
-		public object DataItem {
+		public virtual object DataItem {
 			get {
 				EnsureDataBound ();
 				return dataItem;
@@ -870,7 +871,7 @@ namespace System.Web.UI.WebControls
 	
 		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
 		[BrowsableAttribute (false)]
-		public int DataItemIndex {
+		public virtual int DataItemIndex {
 			get { return PageIndex; }
 		}		
 	
@@ -1291,7 +1292,12 @@ namespace System.Web.UI.WebControls
 			}
 			return base.OnBubbleEvent (source, e);
 		}
-		
+
+		void IPostBackEventHandler.RaisePostBackEvent (string eventArgument)
+		{
+			RaisePostBackEvent (eventArgument);
+		}
+
 		// TODO: This is prolly obsolete
 		protected virtual void RaisePostBackEvent (string eventArgument)
 		{
@@ -1306,69 +1312,69 @@ namespace System.Web.UI.WebControls
 		{
 			switch (eventName)
 			{
-				case DataControlCommands.PageCommandName:
-					int newIndex = -1;
-					switch (param) {
-						case DataControlCommands.FirstPageCommandArgument:
-							newIndex = 0;
-							break;
-						case DataControlCommands.LastPageCommandArgument:
-							newIndex = PageCount - 1;
-							break;
-						case DataControlCommands.NextPageCommandArgument:
-							if (PageIndex < PageCount - 1) newIndex = PageIndex + 1;
-							break;
-						case DataControlCommands.PreviousPageCommandArgument:
-							if (PageIndex > 0) newIndex = PageIndex - 1;
-							break;
-						default:
-							newIndex = int.Parse (param) - 1;
-							break;
-					}
-					ShowPage (newIndex);
-					break;
-					
+			case DataControlCommands.PageCommandName:
+				int newIndex = -1;
+				switch (param) {
 				case DataControlCommands.FirstPageCommandArgument:
-					ShowPage (0);
+					newIndex = 0;
 					break;
-
 				case DataControlCommands.LastPageCommandArgument:
-					ShowPage (PageCount - 1);
+					newIndex = PageCount - 1;
 					break;
-					
 				case DataControlCommands.NextPageCommandArgument:
-					if (PageIndex < PageCount - 1)
-						ShowPage (PageIndex + 1);
+					if (PageIndex < PageCount - 1) newIndex = PageIndex + 1;
 					break;
-
 				case DataControlCommands.PreviousPageCommandArgument:
-					if (PageIndex > 0)
-						ShowPage (PageIndex - 1);
+					if (PageIndex > 0) newIndex = PageIndex - 1;
 					break;
-					
-				case DataControlCommands.EditCommandName:
-					ChangeMode (DetailsViewMode.Edit);
+				default:
+					newIndex = int.Parse (param) - 1;
 					break;
+				}
+				ShowPage (newIndex);
+				break;
 					
-				case DataControlCommands.NewCommandName:
-					ChangeMode (DetailsViewMode.Insert);
-					break;
+			case DataControlCommands.FirstPageCommandArgument:
+				ShowPage (0);
+				break;
+
+			case DataControlCommands.LastPageCommandArgument:
+				ShowPage (PageCount - 1);
+				break;
 					
-				case DataControlCommands.UpdateCommandName:
-					UpdateItem (param, true);
-					break;
+			case DataControlCommands.NextPageCommandArgument:
+				if (PageIndex < PageCount - 1)
+					ShowPage (PageIndex + 1);
+				break;
+
+			case DataControlCommands.PreviousPageCommandArgument:
+				if (PageIndex > 0)
+					ShowPage (PageIndex - 1);
+				break;
 					
-				case DataControlCommands.CancelCommandName:
-					CancelEdit ();
-					break;
+			case DataControlCommands.EditCommandName:
+				ChangeMode (DetailsViewMode.Edit);
+				break;
 					
-				case DataControlCommands.DeleteCommandName:
-					DeleteItem ();
-					break;
+			case DataControlCommands.NewCommandName:
+				ChangeMode (DetailsViewMode.Insert);
+				break;
 					
-				case DataControlCommands.InsertCommandName:
-					InsertItem (true);
-					break;
+			case DataControlCommands.UpdateCommandName:
+				UpdateItem (param, true);
+				break;
+					
+			case DataControlCommands.CancelCommandName:
+				CancelEdit ();
+				break;
+					
+			case DataControlCommands.DeleteCommandName:
+				DeleteItem ();
+				break;
+					
+			case DataControlCommands.InsertCommandName:
+				InsertItem (true);
+				break;
 			}
 		}
 		
@@ -1430,7 +1436,7 @@ namespace System.Web.UI.WebControls
 				EndRowEdit ();
 		}
 
-        bool UpdateCallback (int recordsAffected, Exception exception)
+		bool UpdateCallback (int recordsAffected, Exception exception)
 		{
 			DetailsViewUpdatedEventArgs dargs = new DetailsViewUpdatedEventArgs (recordsAffected, exception, currentEditRowKeys, currentEditOldValues, currentEditNewValues);
 			OnItemUpdated (dargs);
@@ -1464,7 +1470,7 @@ namespace System.Web.UI.WebControls
 				EndRowEdit ();
 		}
 		
-        bool InsertCallback (int recordsAffected, Exception exception)
+		bool InsertCallback (int recordsAffected, Exception exception)
 		{
 			DetailsViewInsertedEventArgs dargs = new DetailsViewInsertedEventArgs (recordsAffected, exception, currentEditNewValues);
 			OnItemInserted (dargs);
@@ -1475,7 +1481,7 @@ namespace System.Web.UI.WebControls
 			return dargs.ExceptionHandled;
 		}
 
-		public void DeleteItem ()
+		public virtual void DeleteItem ()
 		{
 			currentEditRowKeys = DataKey.Values;
 			currentEditNewValues = GetRowValues (true, true);
@@ -1497,7 +1503,7 @@ namespace System.Web.UI.WebControls
 			}
 		}
 
-        bool DeleteCallback (int recordsAffected, Exception exception)
+		bool DeleteCallback (int recordsAffected, Exception exception)
 		{
 			DetailsViewDeletedEventArgs dargs = new DetailsViewDeletedEventArgs (recordsAffected, exception, currentEditRowKeys, currentEditNewValues);
 			OnItemDeleted (dargs);
@@ -1529,7 +1535,7 @@ namespace System.Web.UI.WebControls
 			object bstate = base.SaveControlState ();
 			return new object[] {
 				bstate, pageIndex, pageCount, currentMode
-			};
+					};
 		}
 		
 		protected override void TrackViewState()
@@ -1624,12 +1630,13 @@ namespace System.Web.UI.WebControls
 			if (states[12] != null && oldEditValues != null) ((IStateManager)oldEditValues).LoadViewState (states[12]);
 		}
 		
-		string ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
+		void ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
 		{
-			return RaiseCallbackEvent (eventArgs);
+			RaiseCallbackEvent (eventArgs);
 		}
 		
-		protected virtual string RaiseCallbackEvent (string eventArgs)
+		string callbackResult;
+		protected virtual void RaiseCallbackEvent (string eventArgs)
 		{
 			string[] clientData = eventArgs.Split ('|');
 			pageIndex = int.Parse (clientData[0]);
@@ -1643,7 +1650,17 @@ namespace System.Web.UI.WebControls
 
 			HtmlTextWriter writer = new HtmlTextWriter (sw);
 			RenderGrid (writer);
-			return sw.ToString ();
+			callbackResult = sw.ToString ();
+		}
+
+		string ICallbackEventHandler.GetCallbackResult ()
+		{
+			return GetCallbackResult ();
+		}
+
+		protected virtual string GetCallbackResult ()
+		{
+			return callbackResult;
 		}
 
 		[MonoTODO]
@@ -1684,7 +1701,7 @@ namespace System.Web.UI.WebControls
 				Page.ClientScript.RegisterStartupScript (typeof(TreeView), this.UniqueID, script, true);
 				
 				// Make sure the basic script infrastructure is rendered
-		        Page.ClientScript.GetCallbackEventReference (this, "null", "", "null");
+				Page.ClientScript.GetCallbackEventReference (this, "null", "", "null");
 				Page.ClientScript.GetPostBackClientHyperlink (this, "");
 			}
 		}
@@ -1703,21 +1720,21 @@ namespace System.Web.UI.WebControls
 		void RenderGrid (HtmlTextWriter writer)
 		{
 			switch (GridLines) {
-				case GridLines.Horizontal:
-					writer.AddAttribute (HtmlTextWriterAttribute.Rules, "rows");
-					writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
-					break;
-				case GridLines.Vertical:
-					writer.AddAttribute (HtmlTextWriterAttribute.Rules, "cols");
-					writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
-					break;
-				case GridLines.Both:
-					writer.AddAttribute (HtmlTextWriterAttribute.Rules, "all");
-					writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
-					break;
-				default:
-					writer.AddAttribute (HtmlTextWriterAttribute.Border, "0");
-					break;
+			case GridLines.Horizontal:
+				writer.AddAttribute (HtmlTextWriterAttribute.Rules, "rows");
+				writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
+				break;
+			case GridLines.Vertical:
+				writer.AddAttribute (HtmlTextWriterAttribute.Rules, "cols");
+				writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
+				break;
+			case GridLines.Both:
+				writer.AddAttribute (HtmlTextWriterAttribute.Rules, "all");
+				writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
+				break;
+			default:
+				writer.AddAttribute (HtmlTextWriterAttribute.Border, "0");
+				break;
 			}
 			
 			writer.AddAttribute (HtmlTextWriterAttribute.Cellspacing, "0");
@@ -1727,21 +1744,21 @@ namespace System.Web.UI.WebControls
 			foreach (DetailsViewRow row in table.Rows)
 			{
 				switch (row.RowType) {
-					case DataControlRowType.Header:
-						if (headerStyle != null)headerStyle.AddAttributesToRender (writer, row);
-						break;
-					case DataControlRowType.Footer:
-						if (footerStyle != null) footerStyle.AddAttributesToRender (writer, row);
-						break;
-					case DataControlRowType.Pager:
-						if (pagerStyle != null) pagerStyle.AddAttributesToRender (writer, row);
-						break;
-					case DataControlRowType.EmptyDataRow:
-						if (emptyDataRowStyle != null) emptyDataRowStyle.AddAttributesToRender (writer, row);
-						break;
-					default:
-						if (rowStyle != null) rowStyle.AddAttributesToRender (writer, row);
-						break;
+				case DataControlRowType.Header:
+					if (headerStyle != null)headerStyle.AddAttributesToRender (writer, row);
+					break;
+				case DataControlRowType.Footer:
+					if (footerStyle != null) footerStyle.AddAttributesToRender (writer, row);
+					break;
+				case DataControlRowType.Pager:
+					if (pagerStyle != null) pagerStyle.AddAttributesToRender (writer, row);
+					break;
+				case DataControlRowType.EmptyDataRow:
+					if (emptyDataRowStyle != null) emptyDataRowStyle.AddAttributesToRender (writer, row);
+					break;
+				default:
+					if (rowStyle != null) rowStyle.AddAttributesToRender (writer, row);
+					break;
 				}
 
 				if ((row.RowState & DataControlRowState.Alternate) != 0 && alternatingRowStyle != null)
@@ -1773,6 +1790,13 @@ namespace System.Web.UI.WebControls
 			}
 			table.RenderEndTag (writer);
 		}
+
+
+		[MonoTODO]
+		PostBackOptions IPostBackContainer.GetPostBackOptions (IButtonControl control)
+		{
+			throw new NotImplementedException ();
+		}
 	}
 }
 

+ 155 - 149
mcs/class/System.Web/System.Web.UI.WebControls/FormView.cs

@@ -40,12 +40,13 @@ using System.Reflection;
 
 namespace System.Web.UI.WebControls
 {
+	[SupportsEventValidation]
 	[DesignerAttribute ("System.Web.UI.Design.WebControls.FormViewDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
 	[ControlValuePropertyAttribute ("SelectedValue")]
 	[DefaultEventAttribute ("PageIndexChanging")]
 	[AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public class FormView: CompositeDataBoundControl, IDataItemContainer, INamingContainer
+	public class FormView: CompositeDataBoundControl, IDataItemContainer, INamingContainer, IPostBackEventHandler, IPostBackContainer
 	{
 		object dataItem;
 		
@@ -267,7 +268,7 @@ namespace System.Web.UI.WebControls
 		
 		[WebCategoryAttribute ("Paging")]
 		[DefaultValueAttribute (false)]
-		public bool AllowPaging {
+		public virtual bool AllowPaging {
 			get {
 				object ob = ViewState ["AllowPaging"];
 				if (ob != null) return (bool) ob;
@@ -307,7 +308,7 @@ namespace System.Web.UI.WebControls
 		[WebCategoryAttribute ("Accessibility")]
 		[DefaultValueAttribute ("")]
 		[LocalizableAttribute (true)]
-		public string Caption {
+		public virtual string Caption {
 			get {
 				object ob = ViewState ["Caption"];
 				if (ob != null) return (string) ob;
@@ -364,16 +365,16 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-	    [BrowsableAttribute (false)]
+		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
+		[BrowsableAttribute (false)]
 		public FormViewMode CurrentMode {
 			get {
 				return currentMode;
 			}
 		}
 	
-	    [DefaultValueAttribute (FormViewMode.ReadOnly)]
-	    [WebCategoryAttribute ("Behavior")]
+		[DefaultValueAttribute (FormViewMode.ReadOnly)]
+		[WebCategoryAttribute ("Behavior")]
 		public virtual FormViewMode DefaultMode {
 			get {
 				object o = ViewState ["DefaultMode"];
@@ -415,18 +416,18 @@ namespace System.Web.UI.WebControls
 		[DefaultValue (null)]
 		[TemplateContainer (typeof(FormView), BindingDirection.TwoWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate EditItemTemplate {
+		[Browsable (false)]
+		public virtual ITemplate EditItemTemplate {
 			get { return editItemTemplate; }
 			set { editItemTemplate = value; RequireBinding (); }
 		}
 
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-	    [DefaultValueAttribute (null)]
-		public virtual TableItemStyle EditRowStyle {
+		[DefaultValueAttribute (null)]
+		public TableItemStyle EditRowStyle {
 			get {
 				if (editRowStyle == null) {
 					editRowStyle = new TableItemStyle ();
@@ -437,12 +438,12 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-	    [DefaultValueAttribute (null)]
-		public virtual TableItemStyle EmptyDataRowStyle {
+		[DefaultValueAttribute (null)]
+		public TableItemStyle EmptyDataRowStyle {
 			get {
 				if (emptyDataRowStyle == null) {
 					emptyDataRowStyle = new TableItemStyle ();
@@ -456,8 +457,8 @@ namespace System.Web.UI.WebControls
 		[DefaultValue (null)]
 		[TemplateContainer (typeof(FormView), BindingDirection.OneWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate EmptyDataTemplate {
+		[Browsable (false)]
+		public virtual ITemplate EmptyDataTemplate {
 			get { return emptyDataTemplate; }
 			set { emptyDataTemplate = value; RequireBinding (); }
 		}
@@ -489,16 +490,16 @@ namespace System.Web.UI.WebControls
 		[DefaultValue (null)]
 		[TemplateContainer (typeof(FormView), BindingDirection.OneWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate FooterTemplate {
+		[Browsable (false)]
+		public virtual ITemplate FooterTemplate {
 			get { return footerTemplate; }
 			set { footerTemplate = value; RequireBinding (); }
 		}
 
-	    [LocalizableAttribute (true)]
-	    [WebCategoryAttribute ("Appearance")]
-	    [DefaultValueAttribute ("")]
-		public string FooterText {
+		[LocalizableAttribute (true)]
+		[WebCategoryAttribute ("Appearance")]
+		[DefaultValueAttribute ("")]
+		public virtual string FooterText {
 			get {
 				object ob = ViewState ["FooterText"];
 				if (ob != null) return (string) ob;
@@ -510,12 +511,12 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DefaultValue (null)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle FooterStyle {
+		public TableItemStyle FooterStyle {
 			get {
 				if (footerStyle == null) {
 					footerStyle = new TableItemStyle ();
@@ -548,12 +549,12 @@ namespace System.Web.UI.WebControls
 			}
 		}
 	
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DefaultValue (null)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle HeaderStyle {
+		public TableItemStyle HeaderStyle {
 			get {
 				if (headerStyle == null) {
 					headerStyle = new TableItemStyle ();
@@ -567,16 +568,16 @@ namespace System.Web.UI.WebControls
 		[DefaultValue (null)]
 		[TemplateContainer (typeof(FormView), BindingDirection.OneWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate HeaderTemplate {
+		[Browsable (false)]
+		public virtual ITemplate HeaderTemplate {
 			get { return headerTemplate; }
 			set { headerTemplate = value; RequireBinding (); }
 		}
 
-	    [LocalizableAttribute (true)]
-	    [WebCategoryAttribute ("Appearance")]
-	    [DefaultValueAttribute ("")]
-		public string HeaderText {
+		[LocalizableAttribute (true)]
+		[WebCategoryAttribute ("Appearance")]
+		[DefaultValueAttribute ("")]
+		public virtual string HeaderText {
 			get {
 				object ob = ViewState ["HeaderText"];
 				if (ob != null) return (string) ob;
@@ -605,18 +606,18 @@ namespace System.Web.UI.WebControls
 		[DefaultValue (null)]
 		[TemplateContainer (typeof(FormView), BindingDirection.TwoWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate InsertItemTemplate {
+		[Browsable (false)]
+		public virtual ITemplate InsertItemTemplate {
 			get { return insertItemTemplate; }
 			set { insertItemTemplate = value; RequireBinding (); }
 		}
 
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-	    [DefaultValueAttribute (null)]
-		public virtual TableItemStyle InsertRowStyle {
+		[DefaultValueAttribute (null)]
+		public TableItemStyle InsertRowStyle {
 			get {
 				if (insertRowStyle == null) {
 					insertRowStyle = new TableItemStyle ();
@@ -630,15 +631,15 @@ namespace System.Web.UI.WebControls
 		[DefaultValue (null)]
 		[TemplateContainer (typeof(FormView), BindingDirection.TwoWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate ItemTemplate {
+		[Browsable (false)]
+		public virtual ITemplate ItemTemplate {
 			get { return itemTemplate; }
 			set { itemTemplate = value; RequireBinding (); }
 		}
 		
 		[BrowsableAttribute (false)]
 		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-		public int PageCount {
+		public virtual int PageCount {
 			get {
 				if (pageCount != -1) return pageCount;
 				EnsureDataBound ();
@@ -647,9 +648,9 @@ namespace System.Web.UI.WebControls
 		}
 
 		[WebCategoryAttribute ("Paging")]
-	    [BindableAttribute (true, BindingDirection.OneWay)]
+		[BindableAttribute (true, BindingDirection.OneWay)]
 		[DefaultValueAttribute (0)]
-		public int PageIndex {
+		public virtual int PageIndex {
 			get {
 				return pageIndex;
 			}
@@ -663,7 +664,7 @@ namespace System.Web.UI.WebControls
 		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Content)]
 		[NotifyParentPropertyAttribute (true)]
 		[PersistenceModeAttribute (PersistenceMode.InnerProperty)]
-		public PagerSettings PagerSettings {
+		public virtual PagerSettings PagerSettings {
 			get {
 				if (pagerSettings == null) {
 					pagerSettings = new PagerSettings (this);
@@ -674,11 +675,11 @@ namespace System.Web.UI.WebControls
 			}
 		}
 	
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle PagerStyle {
+		public TableItemStyle PagerStyle {
 			get {
 				if (pagerStyle == null) {
 					pagerStyle = new TableItemStyle ();
@@ -694,27 +695,27 @@ namespace System.Web.UI.WebControls
 		/* DataControlPagerCell isnt specified in the docs */
 		//[TemplateContainer (typeof(DataControlPagerCell), BindingDirection.OneWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate PagerTemplate {
+		[Browsable (false)]
+		public virtual ITemplate PagerTemplate {
 			get { return pagerTemplate; }
 			set { pagerTemplate = value; RequireBinding (); }
 		}
 		
-		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-		[BrowsableAttribute (false)]
-		public FormViewRow Row {
+		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
+		[BrowsableAttribute (false)]
+		public virtual FormViewRow Row {
 			get {
 				EnsureDataBound ();
 				return itemRow;
 			}
 		}
-	    
-	    [WebCategoryAttribute ("Styles")]
+		
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
 		[DefaultValue (null)]
-		public virtual TableItemStyle RowStyle {
+		public TableItemStyle RowStyle {
 			get {
 				if (rowStyle == null) {
 					rowStyle = new TableItemStyle ();
@@ -725,9 +726,9 @@ namespace System.Web.UI.WebControls
 			}
 		}
 
-	    [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
+		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
 		[BrowsableAttribute (false)]
-		public virtual object SelectedValue {
+		public object SelectedValue {
 			get { return DataKey.Value; }
 		}
 		
@@ -742,7 +743,7 @@ namespace System.Web.UI.WebControls
 	
 		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
 		[BrowsableAttribute (false)]
-		public object DataItem {
+		public virtual object DataItem {
 			get {
 				EnsureDataBound ();
 				return dataItem;
@@ -757,7 +758,7 @@ namespace System.Web.UI.WebControls
 	
 		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
 		[BrowsableAttribute (false)]
-		public int DataItemIndex {
+		public virtual int DataItemIndex {
 			get { return PageIndex; }
 		}		
 	
@@ -1068,12 +1069,6 @@ namespace System.Web.UI.WebControls
 			base.OnInit (e);
 		}
 		
-		protected override void OnDataSourceViewChanged (object sender, EventArgs e)
-		{
-			base.OnDataSourceViewChanged (sender, e);
-			RequireBinding ();
-		}
-		
 		protected override bool OnBubbleEvent (object source, EventArgs e)
 		{
 			FormViewCommandEventArgs args = e as FormViewCommandEventArgs;
@@ -1084,7 +1079,11 @@ namespace System.Web.UI.WebControls
 			return base.OnBubbleEvent (source, e);
 		}
 		
-		// This is prolly obsolete
+                void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
+		{
+			RaisePostBackEvent (eventArgument);
+		}
+
 		protected virtual void RaisePostBackEvent (string eventArgument)
 		{
 			int i = eventArgument.IndexOf ('$');
@@ -1098,69 +1097,69 @@ namespace System.Web.UI.WebControls
 		{
 			switch (eventName)
 			{
-				case DataControlCommands.PageCommandName:
-					int newIndex = -1;
-					switch (param) {
-						case DataControlCommands.FirstPageCommandArgument:
-							newIndex = 0;
-							break;
-						case DataControlCommands.LastPageCommandArgument:
-							newIndex = PageCount - 1;
-							break;
-						case DataControlCommands.NextPageCommandArgument:
-							if (PageIndex < PageCount - 1) newIndex = PageIndex + 1;
-							break;
-						case DataControlCommands.PreviousPageCommandArgument:
-							if (PageIndex > 0) newIndex = PageIndex - 1;
-							break;
-						default:
-							newIndex = int.Parse (param) - 1;
-							break;
-					}
-					ShowPage (newIndex);
-					break;
-					
+			case DataControlCommands.PageCommandName:
+				int newIndex = -1;
+				switch (param) {
 				case DataControlCommands.FirstPageCommandArgument:
-					ShowPage (0);
+					newIndex = 0;
 					break;
-
 				case DataControlCommands.LastPageCommandArgument:
-					ShowPage (PageCount - 1);
+					newIndex = PageCount - 1;
 					break;
-					
 				case DataControlCommands.NextPageCommandArgument:
-					if (PageIndex < PageCount - 1)
-						ShowPage (PageIndex + 1);
+					if (PageIndex < PageCount - 1) newIndex = PageIndex + 1;
 					break;
-
 				case DataControlCommands.PreviousPageCommandArgument:
-					if (PageIndex > 0)
-						ShowPage (PageIndex - 1);
+					if (PageIndex > 0) newIndex = PageIndex - 1;
 					break;
-					
-				case DataControlCommands.EditCommandName:
-					ChangeMode (FormViewMode.Edit);
+				default:
+					newIndex = int.Parse (param) - 1;
 					break;
+				}
+				ShowPage (newIndex);
+				break;
 					
-				case DataControlCommands.NewCommandName:
-					ChangeMode (FormViewMode.Insert);
-					break;
+			case DataControlCommands.FirstPageCommandArgument:
+				ShowPage (0);
+				break;
+
+			case DataControlCommands.LastPageCommandArgument:
+				ShowPage (PageCount - 1);
+				break;
 					
-				case DataControlCommands.UpdateCommandName:
-					UpdateItem (param, true);
-					break;
+			case DataControlCommands.NextPageCommandArgument:
+				if (PageIndex < PageCount - 1)
+					ShowPage (PageIndex + 1);
+				break;
+
+			case DataControlCommands.PreviousPageCommandArgument:
+				if (PageIndex > 0)
+					ShowPage (PageIndex - 1);
+				break;
 					
-				case DataControlCommands.CancelCommandName:
-					CancelEdit ();
-					break;
+			case DataControlCommands.EditCommandName:
+				ChangeMode (FormViewMode.Edit);
+				break;
 					
-				case DataControlCommands.DeleteCommandName:
-					DeleteItem ();
-					break;
+			case DataControlCommands.NewCommandName:
+				ChangeMode (FormViewMode.Insert);
+				break;
 					
-				case DataControlCommands.InsertCommandName:
-					InsertItem (true);
-					break;
+			case DataControlCommands.UpdateCommandName:
+				UpdateItem (param, true);
+				break;
+					
+			case DataControlCommands.CancelCommandName:
+				CancelEdit ();
+				break;
+					
+			case DataControlCommands.DeleteCommandName:
+				DeleteItem ();
+				break;
+					
+			case DataControlCommands.InsertCommandName:
+				InsertItem (true);
+				break;
 			}
 		}
 		
@@ -1221,7 +1220,7 @@ namespace System.Web.UI.WebControls
 				EndRowEdit ();
 		}
 
-        bool UpdateCallback (int recordsAffected, Exception exception)
+		bool UpdateCallback (int recordsAffected, Exception exception)
 		{
 			FormViewUpdatedEventArgs dargs = new FormViewUpdatedEventArgs (recordsAffected, exception, currentEditRowKeys, currentEditOldValues, currentEditNewValues);
 			OnItemUpdated (dargs);
@@ -1255,7 +1254,7 @@ namespace System.Web.UI.WebControls
 				EndRowEdit ();
 		}
 		
-        bool InsertCallback (int recordsAffected, Exception exception)
+		bool InsertCallback (int recordsAffected, Exception exception)
 		{
 			FormViewInsertedEventArgs dargs = new FormViewInsertedEventArgs (recordsAffected, exception, currentEditNewValues);
 			OnItemInserted (dargs);
@@ -1266,7 +1265,7 @@ namespace System.Web.UI.WebControls
 			return dargs.ExceptionHandled;
 		}
 
-		public void DeleteItem ()
+		public virtual void DeleteItem ()
 		{
 			currentEditRowKeys = DataKey.Values;
 			currentEditNewValues = GetRowValues (true);
@@ -1290,7 +1289,7 @@ namespace System.Web.UI.WebControls
 			}
 		}
 
-        bool DeleteCallback (int recordsAffected, Exception exception)
+		bool DeleteCallback (int recordsAffected, Exception exception)
 		{
 			FormViewDeletedEventArgs dargs = new FormViewDeletedEventArgs (recordsAffected, exception, currentEditRowKeys, currentEditNewValues);
 			OnItemDeleted (dargs);
@@ -1322,7 +1321,7 @@ namespace System.Web.UI.WebControls
 			object bstate = base.SaveControlState ();
 			return new object[] {
 				bstate, pageIndex, pageCount, currentMode
-			};
+					};
 		}
 		
 		protected override void TrackViewState()
@@ -1389,21 +1388,21 @@ namespace System.Web.UI.WebControls
 		protected internal override void Render (HtmlTextWriter writer)
 		{
 			switch (GridLines) {
-				case GridLines.Horizontal:
-					writer.AddAttribute (HtmlTextWriterAttribute.Rules, "rows");
-					writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
-					break;
-				case GridLines.Vertical:
-					writer.AddAttribute (HtmlTextWriterAttribute.Rules, "cols");
-					writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
-					break;
-				case GridLines.Both:
-					writer.AddAttribute (HtmlTextWriterAttribute.Rules, "all");
-					writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
-					break;
-				default:
-					writer.AddAttribute (HtmlTextWriterAttribute.Border, "0");
-					break;
+			case GridLines.Horizontal:
+				writer.AddAttribute (HtmlTextWriterAttribute.Rules, "rows");
+				writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
+				break;
+			case GridLines.Vertical:
+				writer.AddAttribute (HtmlTextWriterAttribute.Rules, "cols");
+				writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
+				break;
+			case GridLines.Both:
+				writer.AddAttribute (HtmlTextWriterAttribute.Rules, "all");
+				writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
+				break;
+			default:
+				writer.AddAttribute (HtmlTextWriterAttribute.Border, "0");
+				break;
 			}
 			
 			writer.AddAttribute (HtmlTextWriterAttribute.Cellspacing, "0");
@@ -1413,21 +1412,21 @@ namespace System.Web.UI.WebControls
 			foreach (FormViewRow row in table.Rows)
 			{
 				switch (row.RowType) {
-					case DataControlRowType.Header:
-						if (headerStyle != null)headerStyle.AddAttributesToRender (writer, row);
-						break;
-					case DataControlRowType.Footer:
-						if (footerStyle != null) footerStyle.AddAttributesToRender (writer, row);
-						break;
-					case DataControlRowType.Pager:
-						if (pagerStyle != null) pagerStyle.AddAttributesToRender (writer, row);
-						break;
-					case DataControlRowType.EmptyDataRow:
-						if (emptyDataRowStyle != null) emptyDataRowStyle.AddAttributesToRender (writer, row);
-						break;
-					default:
-						if (rowStyle != null) rowStyle.AddAttributesToRender (writer, row);
-						break;
+				case DataControlRowType.Header:
+					if (headerStyle != null)headerStyle.AddAttributesToRender (writer, row);
+					break;
+				case DataControlRowType.Footer:
+					if (footerStyle != null) footerStyle.AddAttributesToRender (writer, row);
+					break;
+				case DataControlRowType.Pager:
+					if (pagerStyle != null) pagerStyle.AddAttributesToRender (writer, row);
+					break;
+				case DataControlRowType.EmptyDataRow:
+					if (emptyDataRowStyle != null) emptyDataRowStyle.AddAttributesToRender (writer, row);
+					break;
+				default:
+					if (rowStyle != null) rowStyle.AddAttributesToRender (writer, row);
+					break;
 				}
 
 				if ((row.RowState & DataControlRowState.Edit) != 0 && editRowStyle != null)
@@ -1444,6 +1443,13 @@ namespace System.Web.UI.WebControls
 			}
 			table.RenderEndTag (writer);
 		}
+
+		[MonoTODO]
+		PostBackOptions IPostBackContainer.GetPostBackOptions (IButtonControl control)
+		{
+			throw new NotImplementedException ();
+		}
+
 	}
 }
 

+ 163 - 140
mcs/class/System.Web/System.Web.UI.WebControls/GridView.cs

@@ -40,12 +40,13 @@ using System.Reflection;
 
 namespace System.Web.UI.WebControls
 {
+	[SupportsEventValidation]
 	[DesignerAttribute ("System.Web.UI.Design.WebControls.GridViewDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
 	[ControlValuePropertyAttribute ("SelectedValue")]
 	[DefaultEventAttribute ("SelectedIndexChanged")]
 	[AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
-	public class GridView: CompositeDataBoundControl, ICallbackEventHandler, ICallbackContainer
+	public class GridView: CompositeDataBoundControl, ICallbackEventHandler, ICallbackContainer, IPostBackEventHandler, IPostBackContainer
 	{
 		Table table;
 		GridViewRowCollection rows;
@@ -306,7 +307,7 @@ namespace System.Web.UI.WebControls
 		
 		[WebCategoryAttribute ("Paging")]
 		[DefaultValueAttribute (false)]
-		public bool AllowPaging {
+		public virtual bool AllowPaging {
 			get {
 				object ob = ViewState ["AllowPaging"];
 				if (ob != null) return (bool) ob;
@@ -320,7 +321,7 @@ namespace System.Web.UI.WebControls
 		
 		[WebCategoryAttribute ("Behavior")]
 		[DefaultValueAttribute (false)]
-		public bool AllowSorting {
+		public virtual bool AllowSorting {
 			get {
 				object ob = ViewState ["AllowSorting"];
 				if (ob != null) return (bool) ob;
@@ -332,11 +333,11 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle AlternatingRowStyle {
+		public TableItemStyle AlternatingRowStyle {
 			get {
 				if (alternatingRowStyle == null) {
 					alternatingRowStyle = new TableItemStyle ();
@@ -431,7 +432,7 @@ namespace System.Web.UI.WebControls
 		[WebCategoryAttribute ("Accessibility")]
 		[DefaultValueAttribute ("")]
 		[LocalizableAttribute (true)]
-		public string Caption {
+		public virtual string Caption {
 			get {
 				object ob = ViewState ["Caption"];
 				if (ob != null) return (string) ob;
@@ -533,7 +534,7 @@ namespace System.Web.UI.WebControls
 
 		[WebCategoryAttribute ("Misc")]
 		[DefaultValueAttribute (-1)]
-		public int EditIndex {
+		public virtual int EditIndex {
 			get {
 				return editIndex;
 			}
@@ -543,11 +544,11 @@ namespace System.Web.UI.WebControls
 			}
 		}
 	
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle EditRowStyle {
+		public TableItemStyle EditRowStyle {
 			get {
 				if (editRowStyle == null) {
 					editRowStyle = new TableItemStyle ();
@@ -558,11 +559,11 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle EmptyDataRowStyle {
+		public TableItemStyle EmptyDataRowStyle {
 			get {
 				if (emptyDataRowStyle == null) {
 					emptyDataRowStyle = new TableItemStyle ();
@@ -574,10 +575,10 @@ namespace System.Web.UI.WebControls
 		}
 		
 		[DefaultValue (null)]
-		[TemplateContainer (typeof(GridView), BindingDirection.OneWay)]
+		[TemplateContainer (typeof(GridViewRow), BindingDirection.OneWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate EmptyDataTemplate {
+		[Browsable (false)]
+		public virtual ITemplate EmptyDataTemplate {
 			get { return emptyDataTemplate; }
 			set { emptyDataTemplate = value; RequireBinding (); }
 		}
@@ -621,12 +622,12 @@ namespace System.Web.UI.WebControls
 			}
 		}
 	
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DefaultValue (null)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle FooterStyle {
+		public TableItemStyle FooterStyle {
 			get {
 				if (footerStyle == null) {
 					footerStyle = new TableItemStyle ();
@@ -660,12 +661,12 @@ namespace System.Web.UI.WebControls
 			}
 		}
 	
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DefaultValue (null)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle HeaderStyle {
+		public TableItemStyle HeaderStyle {
 			get {
 				if (headerStyle == null) {
 					headerStyle = new TableItemStyle ();
@@ -692,7 +693,7 @@ namespace System.Web.UI.WebControls
 
 		[BrowsableAttribute (false)]
 		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-		public int PageCount {
+		public virtual int PageCount {
 			get {
 				if (pageCount != -1) return pageCount;
 				EnsureDataBound ();
@@ -703,7 +704,7 @@ namespace System.Web.UI.WebControls
 		[WebCategoryAttribute ("Paging")]
 		[BrowsableAttribute (true)]
 		[DefaultValueAttribute (0)]
-		public int PageIndex {
+		public virtual int PageIndex {
 			get {
 				return pageIndex;
 			}
@@ -715,7 +716,7 @@ namespace System.Web.UI.WebControls
 	
 		[DefaultValueAttribute (10)]
 		[WebCategoryAttribute ("Paging")]
-		public int PageSize {
+		public virtual int PageSize {
 			get {
 				object ob = ViewState ["PageSize"];
 				if (ob != null) return (int) ob;
@@ -731,7 +732,7 @@ namespace System.Web.UI.WebControls
 		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Content)]
 		[NotifyParentPropertyAttribute (true)]
 		[PersistenceModeAttribute (PersistenceMode.InnerProperty)]
-		public PagerSettings PagerSettings {
+		public virtual PagerSettings PagerSettings {
 			get {
 				if (pagerSettings == null) {
 					pagerSettings = new PagerSettings (this);
@@ -742,11 +743,11 @@ namespace System.Web.UI.WebControls
 			}
 		}
 	
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle PagerStyle {
+		public TableItemStyle PagerStyle {
 			get {
 				if (pagerStyle == null) {
 					pagerStyle = new TableItemStyle ();
@@ -762,15 +763,15 @@ namespace System.Web.UI.WebControls
 		/* DataControlPagerCell isnt specified in the docs */
 		//[TemplateContainer (typeof(DataControlPagerCell), BindingDirection.OneWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate PagerTemplate {
+		[Browsable (false)]
+		public virtual ITemplate PagerTemplate {
 			get { return pagerTemplate; }
 			set { pagerTemplate = value; RequireBinding (); }
 		}
 		
 		[DefaultValueAttribute ("")]
 		[WebCategoryAttribute ("Accessibility")]
-//		[TypeConverterAttribute (typeof(System.Web.UI.Design.DataColumnSelectionConverter)]
+		//		[TypeConverterAttribute (typeof(System.Web.UI.Design.DataColumnSelectionConverter)]
 		public virtual string RowHeaderColumn {
 			get {
 				object ob = ViewState ["RowHeaderColumn"];
@@ -792,11 +793,11 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle RowStyle {
+		public TableItemStyle RowStyle {
 			get {
 				if (rowStyle == null) {
 					rowStyle = new TableItemStyle ();
@@ -820,18 +821,18 @@ namespace System.Web.UI.WebControls
 		
 		[BindableAttribute (true)]
 		[DefaultValueAttribute (-1)]
-		public int SelectedIndex {
+		public virtual int SelectedIndex {
 			get {
 				return selectedIndex;
 			}
 			set {
-				if (selectedIndex >= 0 && selectedIndex < Rows.Count) {
+				if (Rows != null && selectedIndex >= 0 && selectedIndex < Rows.Count) {
 					int oldIndex = selectedIndex;
 					selectedIndex = -1;
 					Rows [oldIndex].RowState = GetRowState (oldIndex);
 				}
 				selectedIndex = value;
-				if (selectedIndex >= 0 && selectedIndex < Rows.Count) {
+				if (Rows != null && selectedIndex >= 0 && selectedIndex < Rows.Count) {
 					Rows [selectedIndex].RowState = GetRowState (selectedIndex);
 				}
 			}
@@ -848,11 +849,11 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [WebCategoryAttribute ("Styles")]
+		[WebCategoryAttribute ("Styles")]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
 		[NotifyParentProperty (true)]
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
-		public virtual TableItemStyle SelectedRowStyle {
+		public TableItemStyle SelectedRowStyle {
 			get {
 				if (selectedRowStyle == null) {
 					selectedRowStyle = new TableItemStyle ();
@@ -864,7 +865,7 @@ namespace System.Web.UI.WebControls
 		}
 		
 		[BrowsableAttribute (false)]
-		public virtual object SelectedValue {
+		public object SelectedValue {
 			get {
 				if (SelectedDataKey != null)
 					return SelectedDataKey.Value;
@@ -994,9 +995,9 @@ namespace System.Web.UI.WebControls
 				object fitem = null;
 				prop_type = null;
 				PropertyInfo prop_item =  source.DataSource.GetType().GetProperty("Item",
-						  BindingFlags.Instance | BindingFlags.Static |
-						  BindingFlags.Public, null, null,
-						  new Type[] { typeof(int) }, null);
+												  BindingFlags.Instance | BindingFlags.Static |
+												  BindingFlags.Public, null, null,
+												  new Type[] { typeof(int) }, null);
 				
 				if (prop_item != null) {
 					prop_type = prop_item.PropertyType;
@@ -1154,7 +1155,7 @@ namespace System.Web.UI.WebControls
 				table.Rows.Add (row);
 				InitializeRow (row, fields);
 				if (dataBinding) {
-//					row.DataBind ();
+					//					row.DataBind ();
 					OnRowDataBound (new GridViewRowEventArgs (row));
 					if (EditIndex == row.RowIndex)
 						oldEditValues = new DataKey (GetRowValues (row, false, true));
@@ -1247,16 +1248,16 @@ namespace System.Web.UI.WebControls
 			bool accessibleHeader = false;
 
 			switch (row.RowType) {
-				case DataControlRowType.Header:
-					ctype = DataControlCellType.Header; 
-					accessibleHeader = UseAccessibleHeader;
-					break;
-				case DataControlRowType.Footer:
-					ctype = DataControlCellType.Footer;
-					break;
-				default:
-					ctype = DataControlCellType.DataCell;
-					break;
+			case DataControlRowType.Header:
+				ctype = DataControlCellType.Header; 
+				accessibleHeader = UseAccessibleHeader;
+				break;
+			case DataControlRowType.Footer:
+				ctype = DataControlCellType.Footer;
+				break;
+			default:
+				ctype = DataControlCellType.DataCell;
+				break;
 			}
 			
 			for (int n=0; n<fields.Length; n++) {
@@ -1383,6 +1384,11 @@ namespace System.Web.UI.WebControls
 			return base.OnBubbleEvent (source, e);
 		}
 		
+		void IPostBackEventHandler.RaisePostBackEvent (string eventArgument)
+		{
+			RaisePostBackEvent (eventArgument);
+		}
+
 		// This is prolly obsolete
 		protected virtual void RaisePostBackEvent (string eventArgument)
 		{
@@ -1397,69 +1403,69 @@ namespace System.Web.UI.WebControls
 		{
 			switch (eventName)
 			{
-				case DataControlCommands.PageCommandName:
-					int newIndex = -1;
-					switch (param) {
-						case DataControlCommands.FirstPageCommandArgument:
-							newIndex = 0;
-							break;
-						case DataControlCommands.LastPageCommandArgument:
-							newIndex = PageCount - 1;
-							break;
-						case DataControlCommands.NextPageCommandArgument:
-							if (PageIndex < PageCount - 1) newIndex = PageIndex + 1;
-							break;
-						case DataControlCommands.PreviousPageCommandArgument:
-							if (PageIndex > 0) newIndex = PageIndex - 1;
-							break;
-						default:
-							newIndex = int.Parse (param) - 1;
-							break;
-					}
-					ShowPage (newIndex);
-					break;
-					
+			case DataControlCommands.PageCommandName:
+				int newIndex = -1;
+				switch (param) {
 				case DataControlCommands.FirstPageCommandArgument:
-					ShowPage (0);
+					newIndex = 0;
 					break;
-
 				case DataControlCommands.LastPageCommandArgument:
-					ShowPage (PageCount - 1);
+					newIndex = PageCount - 1;
 					break;
-					
 				case DataControlCommands.NextPageCommandArgument:
-					if (PageIndex < PageCount - 1)
-						ShowPage (PageIndex + 1);
+					if (PageIndex < PageCount - 1) newIndex = PageIndex + 1;
 					break;
-
 				case DataControlCommands.PreviousPageCommandArgument:
-					if (PageIndex > 0)
-						ShowPage (PageIndex - 1);
+					if (PageIndex > 0) newIndex = PageIndex - 1;
 					break;
-					
-				case DataControlCommands.SelectCommandName:
-					SelectRow (int.Parse (param));
+				default:
+					newIndex = int.Parse (param) - 1;
 					break;
+				}
+				ShowPage (newIndex);
+				break;
 					
-				case DataControlCommands.EditCommandName:
-					EditRow (int.Parse (param));
-					break;
+			case DataControlCommands.FirstPageCommandArgument:
+				ShowPage (0);
+				break;
+
+			case DataControlCommands.LastPageCommandArgument:
+				ShowPage (PageCount - 1);
+				break;
 					
-				case DataControlCommands.UpdateCommandName:
-					UpdateRow (EditIndex, true);
-					break;
+			case DataControlCommands.NextPageCommandArgument:
+				if (PageIndex < PageCount - 1)
+					ShowPage (PageIndex + 1);
+				break;
+
+			case DataControlCommands.PreviousPageCommandArgument:
+				if (PageIndex > 0)
+					ShowPage (PageIndex - 1);
+				break;
 					
-				case DataControlCommands.CancelCommandName:
-					CancelEdit ();
-					break;
+			case DataControlCommands.SelectCommandName:
+				SelectRow (int.Parse (param));
+				break;
 					
-				case DataControlCommands.DeleteCommandName:
-					DeleteRow (int.Parse (param));
-					break;
+			case DataControlCommands.EditCommandName:
+				EditRow (int.Parse (param));
+				break;
 					
-				case DataControlCommands.SortCommandName:
-					Sort (param);
-					break;
+			case DataControlCommands.UpdateCommandName:
+				UpdateRow (EditIndex, true);
+				break;
+					
+			case DataControlCommands.CancelCommandName:
+				CancelEdit ();
+				break;
+					
+			case DataControlCommands.DeleteCommandName:
+				DeleteRow (int.Parse (param));
+				break;
+					
+			case DataControlCommands.SortCommandName:
+				Sort (param);
+				break;
 			}
 		}
 		
@@ -1477,7 +1483,7 @@ namespace System.Web.UI.WebControls
 			Sort (newSortExpression, newDirection);
 		}
 		
-		public void Sort (string newSortExpression, SortDirection newSortDirection)
+		public virtual void Sort (string newSortExpression, SortDirection newSortDirection)
 		{
 			GridViewSortEventArgs args = new GridViewSortEventArgs (newSortExpression, newSortDirection);
 			OnSorting (args);
@@ -1553,7 +1559,7 @@ namespace System.Web.UI.WebControls
 				EndRowEdit ();
 		}
 
-        bool UpdateCallback (int recordsAffected, Exception exception)
+		bool UpdateCallback (int recordsAffected, Exception exception)
 		{
 			GridViewUpdatedEventArgs dargs = new GridViewUpdatedEventArgs (recordsAffected, exception, currentEditRowKeys, currentEditOldValues, currentEditNewValues);
 			OnRowUpdated (dargs);
@@ -1564,7 +1570,7 @@ namespace System.Web.UI.WebControls
 			return dargs.ExceptionHandled;
 		}
 		
-		public void DeleteRow (int rowIndex)
+		public virtual void DeleteRow (int rowIndex)
 		{
 			GridViewRow row = Rows [rowIndex];
 			currentEditRowKeys = DataKeys [rowIndex].Values;
@@ -1585,7 +1591,7 @@ namespace System.Web.UI.WebControls
 			}
 		}
 
-        bool DeleteCallback (int recordsAffected, Exception exception)
+		bool DeleteCallback (int recordsAffected, Exception exception)
 		{
 			GridViewDeletedEventArgs dargs = new GridViewDeletedEventArgs (recordsAffected, exception, currentEditRowKeys, currentEditNewValues);
 			OnRowDeleted (dargs);
@@ -1619,7 +1625,7 @@ namespace System.Web.UI.WebControls
 			object bstate = base.SaveControlState ();
 			return new object[] {
 				bstate, pageIndex, pageCount, selectedIndex, editIndex, sortExpression, sortDirection
-			};
+					};
 		}
 		
 		protected override void TrackViewState()
@@ -1714,12 +1720,13 @@ namespace System.Web.UI.WebControls
 			if (states[12] != null && oldEditValues != null) ((IStateManager)oldEditValues).LoadViewState (states[12]);
 		}
 		
-		string ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
+		void ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
 		{
-			return RaiseCallbackEvent (eventArgs);
+			RaiseCallbackEvent (eventArgs);
 		}
 		
-		protected virtual string RaiseCallbackEvent (string eventArgs)
+		string callbackResult;
+		protected virtual void RaiseCallbackEvent (string eventArgs)
 		{
 			string[] clientData = eventArgs.Split ('|');
 			pageIndex = int.Parse (clientData[0]);
@@ -1735,9 +1742,19 @@ namespace System.Web.UI.WebControls
 
 			HtmlTextWriter writer = new HtmlTextWriter (sw);
 			RenderGrid (writer);
-			return sw.ToString ();
+			callbackResult = sw.ToString ();
 		}
 		
+		string ICallbackEventHandler.GetCallbackResult ()
+		{
+			return GetCallbackResult ();
+		}
+
+		protected virtual string GetCallbackResult ()
+		{
+			return callbackResult;
+		}
+
 		string ICallbackContainer.GetCallbackScript (IButtonControl control, string argument)
 		{
 			return GetCallbackScript (control, argument);
@@ -1776,7 +1793,7 @@ namespace System.Web.UI.WebControls
 				Page.ClientScript.RegisterStartupScript (typeof(TreeView), this.UniqueID, script, true);
 				
 				// Make sure the basic script infrastructure is rendered
-		        Page.ClientScript.GetCallbackEventReference (this, "null", "", "null");
+				Page.ClientScript.GetCallbackEventReference (this, "null", "", "null");
 				Page.ClientScript.GetPostBackClientHyperlink (this, "");
 			}
 		}
@@ -1795,21 +1812,21 @@ namespace System.Web.UI.WebControls
 		void RenderGrid (HtmlTextWriter writer)
 		{
 			switch (GridLines) {
-				case GridLines.Horizontal:
-					writer.AddAttribute (HtmlTextWriterAttribute.Rules, "rows");
-					writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
-					break;
-				case GridLines.Vertical:
-					writer.AddAttribute (HtmlTextWriterAttribute.Rules, "cols");
-					writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
-					break;
-				case GridLines.Both:
-					writer.AddAttribute (HtmlTextWriterAttribute.Rules, "all");
-					writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
-					break;
-				default:
-					writer.AddAttribute (HtmlTextWriterAttribute.Border, "0");
-					break;
+			case GridLines.Horizontal:
+				writer.AddAttribute (HtmlTextWriterAttribute.Rules, "rows");
+				writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
+				break;
+			case GridLines.Vertical:
+				writer.AddAttribute (HtmlTextWriterAttribute.Rules, "cols");
+				writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
+				break;
+			case GridLines.Both:
+				writer.AddAttribute (HtmlTextWriterAttribute.Rules, "all");
+				writer.AddAttribute (HtmlTextWriterAttribute.Border, "1");
+				break;
+			default:
+				writer.AddAttribute (HtmlTextWriterAttribute.Border, "0");
+				break;
 			}
 			
 			writer.AddAttribute (HtmlTextWriterAttribute.Cellspacing, "0");
@@ -1819,20 +1836,20 @@ namespace System.Web.UI.WebControls
 			foreach (GridViewRow row in table.Rows)
 			{
 				switch (row.RowType) {
-					case DataControlRowType.Header:
-						if (headerStyle != null)headerStyle.AddAttributesToRender (writer, row);
-						break;
-					case DataControlRowType.Footer:
-						if (footerStyle != null) footerStyle.AddAttributesToRender (writer, row);
-						break;
-					case DataControlRowType.Pager:
-						if (pagerStyle != null) pagerStyle.AddAttributesToRender (writer, row);
-						break;
-					case DataControlRowType.EmptyDataRow:
-						if (emptyDataRowStyle != null) emptyDataRowStyle.AddAttributesToRender (writer, row);
-						break;
-					default:
-						break;
+				case DataControlRowType.Header:
+					if (headerStyle != null)headerStyle.AddAttributesToRender (writer, row);
+					break;
+				case DataControlRowType.Footer:
+					if (footerStyle != null) footerStyle.AddAttributesToRender (writer, row);
+					break;
+				case DataControlRowType.Pager:
+					if (pagerStyle != null) pagerStyle.AddAttributesToRender (writer, row);
+					break;
+				case DataControlRowType.EmptyDataRow:
+					if (emptyDataRowStyle != null) emptyDataRowStyle.AddAttributesToRender (writer, row);
+					break;
+				default:
+					break;
 				}
 
 				if ((row.RowState & DataControlRowState.Normal) != 0 && rowStyle != null)
@@ -1851,9 +1868,9 @@ namespace System.Web.UI.WebControls
 					if (fcell != null) {
 						Style cellStyle = null;
 						switch (row.RowType) {
-							case DataControlRowType.Header: cellStyle = fcell.ContainingField.HeaderStyle; break;
-							case DataControlRowType.Footer: cellStyle = fcell.ContainingField.FooterStyle; break;
-							default: cellStyle = fcell.ContainingField.ItemStyle; break;
+						case DataControlRowType.Header: cellStyle = fcell.ContainingField.HeaderStyle; break;
+						case DataControlRowType.Footer: cellStyle = fcell.ContainingField.FooterStyle; break;
+						default: cellStyle = fcell.ContainingField.ItemStyle; break;
 						}
 						if (cellStyle != null)
 							cellStyle.AddAttributesToRender (writer, cell);
@@ -1864,6 +1881,12 @@ namespace System.Web.UI.WebControls
 			}
 			table.RenderEndTag (writer);
 		}
+
+		[MonoTODO]
+		PostBackOptions IPostBackContainer.GetPostBackOptions (IButtonControl control)
+		{
+			throw new NotImplementedException ();
+		}
 	}
 }
 

+ 28 - 27
mcs/class/System.Web/System.Web.UI.WebControls/HotSpot.cs

@@ -35,15 +35,15 @@ using System.Security.Permissions;
 
 namespace System.Web.UI.WebControls
 {
-	[TypeConverterAttribute (typeof(ExpandableObjectConverter))]
+	[TypeConverterAttribute (typeof(ExpandableObjectConverter))]
 	[AspNetHostingPermissionAttribute (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermissionAttribute (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	public abstract class HotSpot: IStateManager
 	{
 		StateBag viewState = new StateBag ();
 		
-	    [LocalizableAttribute (true)]
-	    [DefaultValueAttribute ("")]
+		[LocalizableAttribute (true)]
+		[DefaultValueAttribute ("")]
 		public virtual string AccessKey {
 			get {
 				object o = viewState ["AccessKey"];
@@ -54,10 +54,11 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [NotifyParentPropertyAttribute (true)]
-	    [WebCategoryAttribute ("Behavior")]
-	    [DefaultValueAttribute ("")]
-	    [BindableAttribute (true)]
+		[LocalizableAttribute (true)]
+		[NotifyParentPropertyAttribute (true)]
+		[WebCategoryAttribute ("Behavior")]
+		[DefaultValueAttribute ("")]
+		[BindableAttribute (true)]
 		public virtual string AlternateText {
 			get {
 				object o = viewState ["AlternateText"];
@@ -68,9 +69,9 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [WebCategoryAttribute ("Behavior")]
-	    [DefaultValueAttribute (HotSpotMode.NotSet)]
-	    [NotifyParentPropertyAttribute (true)]
+		[WebCategoryAttribute ("Behavior")]
+		[DefaultValueAttribute (HotSpotMode.NotSet)]
+		[NotifyParentPropertyAttribute (true)]
 		public virtual HotSpotMode HotSpotMode {
 			get {
 				object o = viewState ["HotSpotMode"];
@@ -81,12 +82,12 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [DefaultValueAttribute ("")]
-	    [BindableAttribute (true)]
-	    [EditorAttribute ("System.Web.UI.Design.UrlEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
-	    [NotifyParentPropertyAttribute (true)]
-	    [UrlPropertyAttribute]
-		public virtual string NavigateUrl {
+		[DefaultValueAttribute ("")]
+		[BindableAttribute (true)]
+		[EditorAttribute ("System.Web.UI.Design.UrlEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
+		[NotifyParentPropertyAttribute (true)]
+		[UrlPropertyAttribute]
+		public string NavigateUrl {
 			get {
 				object o = viewState ["NavigateUrl"];
 				return o != null ? (string) o : "";
@@ -96,11 +97,11 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [BindableAttribute (true)]
-	    [WebCategoryAttribute ("Behavior")]
-	    [DefaultValueAttribute ("")]
-	    [NotifyParentPropertyAttribute (true)]
-		public virtual string PostBackValue {
+		[BindableAttribute (true)]
+		[WebCategoryAttribute ("Behavior")]
+		[DefaultValueAttribute ("")]
+		[NotifyParentPropertyAttribute (true)]
+		public string PostBackValue {
 			get {
 				object o = viewState ["PostBackValue"];
 				return o != null ? (string) o : "";
@@ -110,8 +111,8 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [DefaultValueAttribute ((short)0)]
-	    [WebCategoryAttribute ("Accessibility")]
+		[DefaultValueAttribute ((short)0)]
+		[WebCategoryAttribute ("Accessibility")]
 		public virtual short TabIndex {
 			get {
 				object o = viewState ["TabIndex"];
@@ -122,10 +123,10 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [WebCategoryAttribute ("Behavior")]
-	    [NotifyParentPropertyAttribute (true)]
-	    [DefaultValueAttribute ("")]
-	    [TypeConverterAttribute (typeof(TargetConverter))]
+		[WebCategoryAttribute ("Behavior")]
+		[NotifyParentPropertyAttribute (true)]
+		[DefaultValueAttribute ("")]
+		[TypeConverterAttribute (typeof(TargetConverter))]
 		public virtual string Target {
 			get {
 				object o = viewState ["Target"];

+ 4 - 10
mcs/class/System.Web/System.Web.UI.WebControls/LinkButton.cs

@@ -190,11 +190,8 @@ namespace System.Web.UI.WebControls {
 		[WebCategory ("Behavior")]
 #if NET_2_0
 		[Themeable (false)]
-		public virtual
-#else		
-		public
 #endif		
-		string CommandArgument {
+		public string CommandArgument {
 			get {
 				return ViewState.GetString ("CommandArgument", "");
 			}
@@ -208,11 +205,8 @@ namespace System.Web.UI.WebControls {
 		[WebCategory ("Behavior")]
 #if NET_2_0
 		[Themeable (false)]
-		public virtual
-#else		
-		public
 #endif		
-		string CommandName {
+		public string CommandName {
 			get {
 				return ViewState.GetString ("CommandName", "");	
 			}
@@ -297,7 +291,7 @@ namespace System.Web.UI.WebControls {
 		[UrlProperty ("*.aspx")]
 		[DefaultValue ("")]
 		[MonoTODO]
-		public string PostBackUrl {
+		public virtual string PostBackUrl {
 			get {
 				throw new NotImplementedException ();
 			}
@@ -310,7 +304,7 @@ namespace System.Web.UI.WebControls {
 		[Themeable (false)]
 		[WebSysDescription ("")]
 		[WebCategoryAttribute ("Behavior")]
-		public string ValidationGroup {
+		public virtual string ValidationGroup {
 			get {
 				return ViewState.GetString ("ValidationGroup", "");	
 			}

+ 9 - 9
mcs/class/System.Web/System.Web.UI.WebControls/Login.cs

@@ -95,7 +95,7 @@ namespace System.Web.UI.WebControls {
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
 		[NotifyParentProperty (true)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-		public virtual TableItemStyle CheckBoxStyle {
+		public TableItemStyle CheckBoxStyle {
 			get {
 				if (checkBoxStyle == null) {
 					checkBoxStyle = new TableItemStyle ();
@@ -216,7 +216,7 @@ namespace System.Web.UI.WebControls {
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
 		[NotifyParentProperty (true)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-		public virtual TableItemStyle FailureTextStyle {
+		public TableItemStyle FailureTextStyle {
 			get {
 				if (failureTextStyle == null) {
 					failureTextStyle = new TableItemStyle ();
@@ -279,7 +279,7 @@ namespace System.Web.UI.WebControls {
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
 		[NotifyParentProperty (true)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-		public virtual TableItemStyle HyperLinkStyle {
+		public TableItemStyle HyperLinkStyle {
 			get {
 				if (hyperLinkStyle == null) {
 					hyperLinkStyle = new TableItemStyle ();
@@ -310,7 +310,7 @@ namespace System.Web.UI.WebControls {
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
 		[NotifyParentProperty (true)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-		public virtual TableItemStyle InstructionTextStyle {
+		public TableItemStyle InstructionTextStyle {
 			get {
 				if (instructionTextStyle == null) {
 					instructionTextStyle = new TableItemStyle ();
@@ -326,7 +326,7 @@ namespace System.Web.UI.WebControls {
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
 		[NotifyParentProperty (true)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-		public virtual TableItemStyle LabelStyle {
+		public TableItemStyle LabelStyle {
 			get {
 				if (labelStyle == null) {
 					labelStyle = new TableItemStyle ();
@@ -366,7 +366,7 @@ namespace System.Web.UI.WebControls {
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
 		[NotifyParentProperty (true)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-		public virtual Style LoginButtonStyle {
+		public Style LoginButtonStyle {
 			get {
 				if (logonButtonStyle == null) {
 					logonButtonStyle = new Style ();
@@ -551,7 +551,7 @@ namespace System.Web.UI.WebControls {
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
 		[NotifyParentProperty (true)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-		public virtual Style TextBoxStyle {
+		public Style TextBoxStyle {
 			get {
 				if (textBoxStyle == null) {
 					textBoxStyle = new Style ();
@@ -594,7 +594,7 @@ namespace System.Web.UI.WebControls {
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
 		[NotifyParentProperty (true)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-		public virtual TableItemStyle TitleTextStyle {
+		public TableItemStyle TitleTextStyle {
 			get {
 				if (titleTextStyle == null) {
 					titleTextStyle = new TableItemStyle ();
@@ -652,7 +652,7 @@ namespace System.Web.UI.WebControls {
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Content)]
 		[NotifyParentProperty (true)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-		public virtual Style ValidatorTextStyle {
+		public Style ValidatorTextStyle {
 			get {
 				if (validatorTextStyle == null) {
 					validatorTextStyle = new Style ();

+ 17 - 17
mcs/class/System.Web/System.Web.UI.WebControls/SiteMapDataSource.cs

@@ -52,14 +52,14 @@ namespace System.Web.UI.WebControls
 			return emptyNames;
 		}
 		
-		public IList GetList ()
+		public virtual IList GetList ()
 		{
 			return ListSourceHelper.GetList (this);
 		}
 		
-	    [BrowsableAttribute (false)]
-	    [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-		public bool ContainsListCollection {
+		[BrowsableAttribute (false)]
+		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
+		public virtual bool ContainsListCollection {
 			get { return ListSourceHelper.ContainsListCollection (this); }
 		}
 		
@@ -68,8 +68,8 @@ namespace System.Web.UI.WebControls
 			remove { ((IHierarchicalDataSource)this).DataSourceChanged -= value; }
 		}
 		
-	    [BrowsableAttribute (false)]
-	    [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
+		[BrowsableAttribute (false)]
+		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
 		public SiteMapProvider Provider {
 			get {
 				if (provider == null) {
@@ -91,8 +91,8 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [DefaultValueAttribute ("")]
-		public string SiteMapProvider {
+		[DefaultValueAttribute ("")]
+		public virtual string SiteMapProvider {
 			get {
 				object o = ViewState ["SiteMapProvider"];
 				if (o != null) return (string) o;
@@ -104,10 +104,10 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [DefaultValueAttribute ("")]
-	    [EditorAttribute ("System.Web.UI.Design.UrlEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
-	    [UrlPropertyAttribute]
-		public string StartingNodeUrl {
+		[DefaultValueAttribute ("")]
+		[EditorAttribute ("System.Web.UI.Design.UrlEditor, " + Consts.AssemblySystem_Design, "System.Drawing.Design.UITypeEditor, " + Consts.AssemblySystem_Drawing)]
+		[UrlPropertyAttribute]
+		public virtual string StartingNodeUrl {
 			get {
 				object o = ViewState ["StartingNodeUrl"];
 				if (o != null) return (string) o;
@@ -119,8 +119,8 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [DefaultValueAttribute (false)]
-		public bool StartFromCurrentNode {
+		[DefaultValueAttribute (false)]
+		public virtual bool StartFromCurrentNode {
 			get {
 				object o = ViewState ["StartFromCurrentNode"];
 				if (o != null) return (bool) o;
@@ -132,8 +132,8 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [DefaultValueAttribute (true)]
-		public bool ShowStartingNode {
+		[DefaultValueAttribute (true)]
+		public virtual bool ShowStartingNode {
 			get {
 				object o = ViewState ["ShowStartingNode"];
 				if (o != null) return (bool) o;
@@ -145,7 +145,7 @@ namespace System.Web.UI.WebControls
 			}
 		}
 
-		public DataSourceView GetView (string viewName)
+		public virtual DataSourceView GetView (string viewName)
 		{
 			SiteMapNode node = GetStartNode (viewName);
 			if (node == null)

+ 2 - 2
mcs/class/System.Web/System.Web.UI.WebControls/SqlDataSourceCommandType.cs

@@ -32,8 +32,8 @@ namespace System.Web.UI.WebControls {
 
 	public enum SqlDataSourceCommandType
 	{
-		StoredProcedure,
-		Text
+		Text = 0,
+		StoredProcedure = 1
 	}
 
 }

+ 1 - 1
mcs/class/System.Web/System.Web.UI.WebControls/TableSectionStyle.cs

@@ -43,7 +43,7 @@ namespace System.Web.UI.WebControls {
 
 		[DefaultValue (true)]
 		[NotifyParentProperty (true)]
-		public virtual bool Visible {
+		public bool Visible {
 			get {
 // commented to match MS behaviour (beta2)
 //				if ((styles & Styles.Visible) == 0)

+ 14 - 14
mcs/class/System.Web/System.Web.UI.WebControls/TemplateField.cs

@@ -51,8 +51,8 @@ namespace System.Web.UI.WebControls
 		[DefaultValue (null)]
 		[TemplateContainer (typeof(IDataItemContainer), BindingDirection.TwoWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate AlternatingItemTemplate {
+		[Browsable (false)]
+		public virtual ITemplate AlternatingItemTemplate {
 			get { return alternatingItemTemplate; }
 			set { alternatingItemTemplate = value; OnFieldChanged (); }
 		}
@@ -74,8 +74,8 @@ namespace System.Web.UI.WebControls
 		[DefaultValue (null)]
 		[TemplateContainer (typeof(IDataItemContainer), BindingDirection.TwoWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate EditItemTemplate {
+		[Browsable (false)]
+		public virtual ITemplate EditItemTemplate {
 			get { return editItemTemplate; }
 			set { editItemTemplate = value; OnFieldChanged (); }
 		}
@@ -83,8 +83,8 @@ namespace System.Web.UI.WebControls
 		[DefaultValue (null)]
 		[TemplateContainer (typeof(IDataItemContainer), BindingDirection.OneWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate FooterTemplate {
+		[Browsable (false)]
+		public virtual ITemplate FooterTemplate {
 			get { return footerTemplate; }
 			set { footerTemplate = value; OnFieldChanged (); }
 		}
@@ -92,8 +92,8 @@ namespace System.Web.UI.WebControls
 		[DefaultValue (null)]
 		[TemplateContainer (typeof(IDataItemContainer), BindingDirection.OneWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate HeaderTemplate {
+		[Browsable (false)]
+		public virtual ITemplate HeaderTemplate {
 			get { return headerTemplate; }
 			set { headerTemplate = value; OnFieldChanged (); }
 		}
@@ -101,8 +101,8 @@ namespace System.Web.UI.WebControls
 		[DefaultValue (null)]
 		[TemplateContainer (typeof(IDataItemContainer), BindingDirection.TwoWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate InsertItemTemplate {
+		[Browsable (false)]
+		public virtual ITemplate InsertItemTemplate {
 			get { return insertItemTemplate; }
 			set { insertItemTemplate = value; OnFieldChanged (); }
 		}
@@ -110,14 +110,14 @@ namespace System.Web.UI.WebControls
 		[DefaultValue (null)]
 		[TemplateContainer (typeof(IDataItemContainer), BindingDirection.TwoWay)]
 		[PersistenceMode (PersistenceMode.InnerProperty)]
-	    [Browsable (false)]
-		public ITemplate ItemTemplate {
+		[Browsable (false)]
+		public virtual ITemplate ItemTemplate {
 			get { return itemTemplate; }
 			set { itemTemplate = value; OnFieldChanged (); }
 		}
 		
 		public override void InitializeCell (DataControlFieldCell cell,
-			DataControlCellType cellType, DataControlRowState rowState, int rowIndex)
+						     DataControlCellType cellType, DataControlRowState rowState, int rowIndex)
 		{
 			if (cellType == DataControlCellType.Header) {
 				if (headerTemplate != null && ShowHeader) {
@@ -156,7 +156,7 @@ namespace System.Web.UI.WebControls
 		}
 		
 		public override void ExtractValuesFromCell (IOrderedDictionary dictionary,
-			DataControlFieldCell cell, DataControlRowState rowState, bool includeReadOnly)
+							    DataControlFieldCell cell, DataControlRowState rowState, bool includeReadOnly)
 		{
 			IBindableTemplate bt;
 			

+ 48 - 23
mcs/class/System.Web/System.Web.UI.WebControls/TreeNode.cs

@@ -95,6 +95,12 @@ namespace System.Web.UI.WebControls
 			Target = target;
 		}
 		
+		[MonoTODO]
+		protected TreeNode (TreeView owner, bool isRoot)
+		{
+			throw new NotImplementedException ();
+		}
+
 		[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
 		[Browsable (false)]
 		public int Depth {
@@ -160,7 +166,7 @@ namespace System.Web.UI.WebControls
 		}
 		
 		[DefaultValue (false)]
-		public virtual bool Checked {
+		public bool Checked {
 			get {
 				object o = ViewState ["Checked"];
 				if (o != null) return (bool)o;
@@ -177,7 +183,7 @@ namespace System.Web.UI.WebControls
 		[MergableProperty (false)]
 		[Browsable (false)]
 		[PersistenceMode (PersistenceMode.InnerDefaultProperty)]
-		public virtual TreeNodeCollection ChildNodes {
+		public TreeNodeCollection ChildNodes {
 			get {
 				if (nodes == null) {
 					if (PopulateOnDemand && tree == null)
@@ -200,12 +206,12 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-		[DefaultValue (false)]
-		public virtual bool Expanded {
+		[DefaultValue (null)]
+		public bool? Expanded {
 			get {
 				object o = ViewState ["Expanded"];
 				if (o != null) return (bool)o;
-				return false;
+				return true;
 			}
 			set {
 				ViewState ["Expanded"] = value;
@@ -216,7 +222,7 @@ namespace System.Web.UI.WebControls
 
 		[Localizable (true)]
 		[DefaultValue ("")]
-		public virtual string ImageToolTip {
+		public string ImageToolTip {
 			get {
 				object o = ViewState ["ImageToolTip"];
 				if (o != null) return (string)o;
@@ -238,7 +244,7 @@ namespace System.Web.UI.WebControls
 		[DefaultValue ("")]
 		[UrlProperty]
 		[Editor ("System.Web.UI.Design.ImageUrlEditor, " + Consts.AssemblySystem_Design, typeof (System.Drawing.Design.UITypeEditor))]
-		public virtual string ImageUrl {
+		public string ImageUrl {
 			get {
 				object o = ViewState ["ImageUrl"];
 				if (o != null) return (string)o;
@@ -260,7 +266,7 @@ namespace System.Web.UI.WebControls
 		[DefaultValue ("")]
 		[UrlProperty]
 		[Editor ("System.Web.UI.Design.UrlEditor, " + Consts.AssemblySystem_Design, typeof (System.Drawing.Design.UITypeEditor))]
-		public virtual string NavigateUrl {
+		public string NavigateUrl {
 			get {
 				object o = ViewState ["NavigateUrl"];
 				if (o != null) return (string)o;
@@ -313,8 +319,8 @@ namespace System.Web.UI.WebControls
 			}
 		}
 
-		[DefaultValue (false)]
-		public bool ShowCheckBox {
+		[DefaultValue (null)]
+		public bool? ShowCheckBox {
 			get {
 				object o = ViewState ["ShowCheckBox"];
 				if (o != null) return (bool)o;
@@ -323,7 +329,7 @@ namespace System.Web.UI.WebControls
 					if (bin != null)
 						return bin.ShowCheckBox;
 				}
-				return false;
+				return true;
 			}
 			set {
 				ViewState ["ShowCheckBox"] = value;
@@ -335,7 +341,7 @@ namespace System.Web.UI.WebControls
 		}
 
 		[DefaultValue ("")]
-		public virtual string Target {
+		public string Target {
 			get {
 				object o = ViewState ["Target"];
 				if(o != null) return (string)o;
@@ -357,7 +363,7 @@ namespace System.Web.UI.WebControls
 		[Localizable (true)]
 		[DefaultValue ("")]
 		[WebSysDescription ("The display text of the tree node.")]
-		public virtual string Text {
+		public string Text {
 			get {
 				object o = ViewState ["Text"];
 				if (o != null) return (string)o;
@@ -387,7 +393,7 @@ namespace System.Web.UI.WebControls
 
 		[Localizable (true)]
 		[DefaultValue ("")]
-		public virtual string ToolTip {
+		public string ToolTip {
 			get {
 				object o = ViewState ["ToolTip"];
 				if(o != null) return (string)o;
@@ -408,7 +414,7 @@ namespace System.Web.UI.WebControls
 
 		[Localizable (true)]
 		[DefaultValue ("")]
-		public virtual string Value {
+		public string Value {
 			get {
 				object o = ViewState ["Value"];
 				if(o != null) return (string)o;
@@ -430,7 +436,7 @@ namespace System.Web.UI.WebControls
 		}
 		
 		[DefaultValue (false)]
-		public virtual bool Selected {
+		public bool Selected {
 			get {
 				return SelectedFlag;
 			}
@@ -520,7 +526,7 @@ namespace System.Web.UI.WebControls
 			get { return nodes != null; }
 		}
 		
-		protected virtual void Populate ()
+		internal void Populate ()
 		{
 			tree.NotifyPopulateRequired (this);
 		}
@@ -569,7 +575,12 @@ namespace System.Web.UI.WebControls
 			Expanded = !Expanded;
 		}
 
-		public void LoadViewState (object savedState)
+		void IStateManager.LoadViewState (object savedState)
+		{
+			LoadViewState (savedState);
+		}
+
+		protected virtual void LoadViewState (object savedState)
 		{
 			if (savedState == null)
 				return;
@@ -584,7 +595,12 @@ namespace System.Web.UI.WebControls
 				((IStateManager)ChildNodes).LoadViewState (states [1]);
 		}
 		
-		public object SaveViewState ()
+		object IStateManager.SaveViewState ()
+		{
+			return SaveViewState ();
+		}
+
+		protected virtual object SaveViewState ()
 		{
 			object[] states = new object[2];
 			states[0] = ViewState.SaveViewState();
@@ -596,8 +612,13 @@ namespace System.Web.UI.WebControls
 			}
 			return null;
 		}
-		
-		public void TrackViewState ()
+
+		void IStateManager.TrackViewState ()
+		{
+			TrackViewState ();
+		}
+
+		protected void TrackViewState ()
 		{
 			if (marked) return;
 			marked = true;
@@ -607,7 +628,11 @@ namespace System.Web.UI.WebControls
 				((IStateManager)nodes).TrackViewState ();
 		}
 		
-		public bool IsTrackingViewState
+		bool IStateManager.IsTrackingViewState {
+			get { return IsTrackingViewState; }
+		}
+
+		protected bool IsTrackingViewState
 		{
 			get { return marked; }
 		}
@@ -617,7 +642,7 @@ namespace System.Web.UI.WebControls
 			ViewState.SetDirty (true);
 		}
 		
-		public object Clone ()
+		public virtual object Clone ()
 		{
 			TreeNode nod = tree != null ? tree.CreateNode () : new TreeNode ();
 			foreach (DictionaryEntry e in ViewState)

+ 6 - 6
mcs/class/System.Web/System.Web.UI.WebControls/TreeNodeCollection.cs

@@ -77,7 +77,7 @@ namespace System.Web.UI.WebControls
 			child.Tree = tree;
 			child.SetParent (parent);
 			if (marked) {
-				child.TrackViewState ();
+				((IStateManager)child).TrackViewState ();
 				child.SetDirty ();
 				dirty = true;
 			}
@@ -92,7 +92,7 @@ namespace System.Web.UI.WebControls
 			for (int n=index+1; n<items.Count; n++)
 				((TreeNode)items[n]).Index = n;
 			if (marked) {
-				child.TrackViewState ();
+				((IStateManager)child).TrackViewState ();
 				child.SetDirty ();
 				dirty = true;
 			}
@@ -183,7 +183,7 @@ namespace System.Web.UI.WebControls
 				if (oi != -1) node = originalItems [oi];
 				else node = new TreeNode ();
 				if (dirty) Add (node);
-				node.LoadViewState (pair.Second);
+				((IStateManager)node).LoadViewState (pair.Second);
 			}
 		}
 		
@@ -198,7 +198,7 @@ namespace System.Web.UI.WebControls
 				for (int n=0; n<items.Count; n++) {
 					TreeNode node = items[n] as TreeNode;
 					int oi = Array.IndexOf (originalItems, node);
-					object ns = node.SaveViewState ();
+					object ns = ((IStateManager)node).SaveViewState ();
 					if (ns != null) hasData = true;
 					state [n + 1] = new Pair (oi, ns);
 				}
@@ -206,7 +206,7 @@ namespace System.Web.UI.WebControls
 				ArrayList list = new ArrayList ();
 				for (int n=0; n<items.Count; n++) {
 					TreeNode node = items[n] as TreeNode;
-					object ns = node.SaveViewState ();
+					object ns = ((IStateManager)node).SaveViewState ();
 					if (ns != null) {
 						hasData = true;
 						list.Add (new Pair (n, ns));
@@ -230,7 +230,7 @@ namespace System.Web.UI.WebControls
 			originalItems = new TreeNode [items.Count];
 			for (int n=0; n<items.Count; n++) {
 				originalItems [n] = (TreeNode) items [n];
-				originalItems [n].TrackViewState ();
+				((IStateManager)originalItems [n]).TrackViewState ();
 			}
 		}
 		

+ 27 - 15
mcs/class/System.Web/System.Web.UI.WebControls/TreeView.cs

@@ -44,6 +44,7 @@ namespace System.Web.UI.WebControls
 	[AspNetHostingPermission (SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	[AspNetHostingPermission (SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
 	// attributes
+	[SupportsEventValidation]
 	[ControlValueProperty ("SelectedValue")]
 	[DefaultEvent ("SelectedNodeChanged")]
 	[Designer ("System.Web.UI.Design.WebControls.TreeViewDesigner, " + Consts.AssemblySystem_Design, "System.ComponentModel.Design.IDesigner")]
@@ -353,7 +354,7 @@ namespace System.Web.UI.WebControls
 		}
 
 		[DefaultValue ("")]
-		public virtual string LineImagesFolder {
+		public string LineImagesFolder {
 			get {
 				return ViewState.GetString ("LineImagesFolder", "");
 			}
@@ -363,7 +364,7 @@ namespace System.Web.UI.WebControls
 		}
 
 		[DefaultValue (-1)]
-		public virtual int MaxDataBindDepth {
+		public int MaxDataBindDepth {
 			get {
 				return ViewState.GetInt ("MaxDataBindDepth", -1);
 			}
@@ -373,7 +374,7 @@ namespace System.Web.UI.WebControls
 		}
 
 		[DefaultValue (20)]
-		public virtual int NodeIndent {
+		public int NodeIndent {
 			get {
 				return ViewState.GetInt ("NodeIndent", 20);
 			}
@@ -695,7 +696,7 @@ namespace System.Web.UI.WebControls
 
 		internal void NotifyExpandedChanged (TreeNode node)
 		{
-			if (node.Expanded)
+			if (node.Expanded.HasValue && node.Expanded.Value)
 				OnTreeNodeExpanded (new TreeNodeEventArgs (node));
 			else
 				OnTreeNodeCollapsed (new TreeNodeEventArgs (node));
@@ -827,7 +828,8 @@ namespace System.Web.UI.WebControls
 		{
 		}
 		
-		protected virtual string RaiseCallbackEvent (string eventArgs)
+		string callbackResult;
+		protected virtual void RaiseCallbackEvent (string eventArgs)
 		{
 			RequiresDataBinding = true;
 			EnsureDataBound ();
@@ -849,9 +851,14 @@ namespace System.Web.UI.WebControls
 				RenderNode (writer, node.ChildNodes [n], node.Depth + 1, levelLines, true, n<num-1);
 			
 			string res = sw.ToString ();
-			return res != "" ? res : "*";
+			callbackResult = res != "" ? res : "*";
 		}
 		
+		protected virtual string GetCallbackResult ()
+		{
+			return callbackResult;
+		}
+
 		void IPostBackEventHandler.RaisePostBackEvent (string eventArgument)
 		{
 			RaisePostBackEvent (eventArgument);
@@ -867,11 +874,16 @@ namespace System.Web.UI.WebControls
 			RaisePostDataChangedEvent ();
 		}
 		
-		string ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
+		void ICallbackEventHandler.RaiseCallbackEvent (string eventArgs)
 		{
-			return RaiseCallbackEvent (eventArgs);
+			RaiseCallbackEvent (eventArgs);
 		}
 		
+		string ICallbackEventHandler.GetCallbackResult ()
+		{
+			return GetCallbackResult ();
+		}
+
 		protected override ControlCollection CreateControlCollection ()
 		{
 			return new EmptyControlCollection (this);
@@ -1018,7 +1030,7 @@ namespace System.Web.UI.WebControls
 			string nodeImage;
 			bool clientExpand = EnableClientScript && Events [TreeNodeCollapsedEvent] == null && Events [TreeNodeExpandedEvent] == null;
 			ImageStyle imageStyle = GetImageStyle ();
-			bool renderChildNodes = node.Expanded;
+			bool renderChildNodes = node.Expanded.HasValue && node.Expanded.Value;
 			
 			if (clientExpand && !renderChildNodes)
 				renderChildNodes = (!PopulateNodesFromClient || HasChildInputData (node));
@@ -1078,9 +1090,9 @@ namespace System.Web.UI.WebControls
 				if (ShowExpandCollapse) {
 					if (hasChildNodes) {
 						buttonImage = true;
-						if (node.Expanded) shape += "minus";
+						if (node.Expanded.HasValue && node.Expanded.Value) shape += "minus";
 						else shape += "plus";
-						tooltip = GetNodeImageToolTip (!node.Expanded, node.Text);
+						tooltip = GetNodeImageToolTip (!(node.Expanded.HasValue && node.Expanded.Value), node.Text);
 					} else if (!ShowLines)
 						shape = "noexpand";
 				}
@@ -1141,7 +1153,7 @@ namespace System.Web.UI.WebControls
 			
 			bool showChecks;
 			if (node.IsShowCheckBoxSet)
-				showChecks = node.ShowCheckBox;
+				showChecks = node.ShowCheckBox.HasValue && node.ShowCheckBox.Value;
 			else
 				showChecks = (ShowCheckBoxes == TreeNodeTypes.All) ||
 							 (ShowCheckBoxes == TreeNodeTypes.Leaf && node.ChildNodes.Count == 0) ||
@@ -1194,7 +1206,7 @@ namespace System.Web.UI.WebControls
 				}
 				
 				if (clientExpand) {
-					if (!node.Expanded) writer.AddStyleAttribute ("display", "none");
+					if (!(node.Expanded.HasValue && node.Expanded.Value)) writer.AddStyleAttribute ("display", "none");
 					else writer.AddStyleAttribute ("display", "block");
 					writer.AddAttribute ("id", GetNodeClientId (node, null));
 					writer.RenderBeginTag (HtmlTextWriterTag.Span);
@@ -1382,7 +1394,7 @@ namespace System.Web.UI.WebControls
 		void UnsetExpandStates (TreeNodeCollection col, string[] states)
 		{
 			foreach (TreeNode node in col) {
-				if (node.Expanded) {
+				if (node.Expanded.HasValue && node.Expanded.Value) {
 					bool expand = (Array.IndexOf (states, node.Path) != -1);
 					if (!expand) node.Expanded = false;
 				}
@@ -1412,7 +1424,7 @@ namespace System.Web.UI.WebControls
 		
 		void GetExpandStates (StringBuilder sb, TreeNode node)
 		{
-			if (node.Expanded) {
+			if (node.Expanded.HasValue && node.Expanded.Value) {
 				sb.Append (node.Path);
 				sb.Append ('|');
 			}

+ 1 - 1
mcs/class/System.Web/System.Web.UI.WebControls/ValidationSummary.cs

@@ -149,7 +149,7 @@ namespace System.Web.UI.WebControls {
 #if NET_2_0
 		[DefaultValue ("")]
 		[Themeable (false)]
-		public string ValidationGroup
+		public virtual string ValidationGroup
 		{
 			get {
 				return ViewState.GetString("ValidationGroup", string.Empty);

+ 11 - 11
mcs/class/System.Web/System.Web.UI.WebControls/WizardStepBase.cs

@@ -42,9 +42,9 @@ namespace System.Web.UI.WebControls
 	{
 		Wizard wizard;
 		
-	    [DefaultValueAttribute (true)]
-	    [ThemeableAttribute (false)]
-	    [FilterableAttribute (false)]
+		[DefaultValueAttribute (true)]
+		[ThemeableAttribute (false)]
+		[FilterableAttribute (false)]
 		public virtual bool AllowReturn {
 			get {
 				object v = ViewState ["AllowReturn"];
@@ -55,9 +55,9 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
-	    [BrowsableAttribute (false)]
-		public string Name {
+		[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
+		[BrowsableAttribute (false)]
+		public virtual string Name {
 			get {
 				if (Title.Length > 0) return Title;
 				else if (ID.Length > 0) return ID;
@@ -65,7 +65,7 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [DefaultValueAttribute (WizardStepType.Auto)]
+		[DefaultValueAttribute (WizardStepType.Auto)]
 		public virtual WizardStepType StepType {
 			get {
 				object v = ViewState ["StepType"];
@@ -76,8 +76,8 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [DefaultValueAttribute ("")]
-	    [LocalizableAttribute (true)]
+		[DefaultValueAttribute ("")]
+		[LocalizableAttribute (true)]
 		public virtual string Title {
 			get {
 				object v = ViewState ["Title"];
@@ -88,8 +88,8 @@ namespace System.Web.UI.WebControls
 			}
 		}
 		
-	    [EditorBrowsableAttribute (EditorBrowsableState.Advanced)]
-	    [BrowsableAttribute (false)]
+		[EditorBrowsableAttribute (EditorBrowsableState.Advanced)]
+		[BrowsableAttribute (false)]
 		public Wizard Wizard {
 			get { return wizard; }
 		}

+ 10 - 0
mcs/class/System.Web/System.Web.UI/ChangeLog

@@ -1,3 +1,13 @@
+2006-02-23  Chris Toshok  <[email protected]>
+
+	* Page.cs (ProcessCallbackData): track change to
+	ICallbackEventHandler iface.
+
+	* ICallbackEventHandler.cs: enable the proper members of this
+	interface.
+
+	* DataSourceSelectArguments.cs: reformat getter/setters.
+	
 2006-02-22  Cesar Lopez Nataren  <[email protected]>
 
 	* HtmlTextWriter.cs: Added method WriteEncodedText for the .NET 2.0 profile.

+ 4 - 12
mcs/class/System.Web/System.Web.UI/DataSourceSelectArguments.cs

@@ -100,9 +100,7 @@ namespace System.Web.UI
 
 		public int MaximumRows {
 			get { return this.maxRows; }
-			set {
-				this.maxRows = value;
-			}
+			set { this.maxRows = value; }
 		}
 
 		public bool RetrieveTotalRowCount  {
@@ -112,23 +110,17 @@ namespace System.Web.UI
 
 		public string SortExpression {
 			get { return this.sortExpression; }
-			set {
-				this.sortExpression = value;
-			}
+			set { this.sortExpression = value; }
 		}
 
 		public int StartRowIndex {
 			get { return this.startingRowIndex; }
-			set {
-				this.startingRowIndex = value;
-			}
+			set { this.startingRowIndex = value; }
 		}
 
 		public int TotalRowCount {
 			get { return this.totalRowCount; }
-			set {
-				this.totalRowCount = value;
-			}
+			set { this.totalRowCount = value; }
 		}
 	}
 }

+ 2 - 3
mcs/class/System.Web/System.Web.UI/ICallbackEventHandler.cs

@@ -35,9 +35,8 @@ namespace System.Web.UI
 {
 	public interface ICallbackEventHandler
 	{
-		//string GetCallbackResult ();
-		//void RaiseCallbackEvent (string eventArgs);
-		string RaiseCallbackEvent (string eventArgs);
+		string GetCallbackResult ();
+		void RaiseCallbackEvent (string eventArgs);
 	}
 }
 #endif

+ 2 - 1
mcs/class/System.Web/System.Web.UI/Page.cs

@@ -1495,7 +1495,8 @@ public class Page : TemplateControl, IHttpHandler
 			throw new HttpException (string.Format ("Invalid callback target '{0}'.", callbackTarget));
 
 		string callbackArgument = _requestValueCollection [CallbackArgumentID];
-		return target.RaiseCallbackEvent (callbackArgument);
+		target.RaiseCallbackEvent (callbackArgument);
+		return target.GetCallbackResult ();
 	}
 
 	[BrowsableAttribute (false)]