From 7c9ee1a3eee8ba8eda6fc266f2936d3930d40248 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Mon, 5 Nov 2001 07:10:08 +0000 Subject: Flush pending changes I got from a contributor that did not put his name in svn path=/trunk/mcs/; revision=1263 --- .../System.Web.UI.HtmlControls/HtmlAnchor.cs | 42 ++++++++-------------- 1 file changed, 15 insertions(+), 27 deletions(-) (limited to 'mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs') diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs index 02997962128..bd319d61b54 100644 --- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs +++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs @@ -9,33 +9,30 @@ using System.Web.UI; namespace System.Web.UI.HtmlControls{ - public class HtmlAnchor : HtmlContainerControl, IPostBackDataHandler{ + public class HtmlAnchor : HtmlContainerControl, IPostBackEventHandler{ - private static readonly object EventServerChange; + private static readonly object EventServerClick; public HtmlAnchor(): base("a"){} protected virtual void OnServerClick(EventArgs e){ EventHandler handler; handler = (EventHandler) Events[EventServerClick]; - if(handler != null){ - handler.Invoke(this, e); - } + if(handler != null) handler.Invoke(this, e); } - protected override void RenderAttributes(HtmlTextWriter writer);{ - if ((EventHandler) Events[EventServerClick] != null){ + protected new void RenderAttributes(HtmlTextWriter writer){ + if ( (EventHandler) Events[EventServerClick] != null){ Attributes.Remove("href"); RenderAttributes(writer); writer.WriteAttribute(Page.GetPostBackClientHyperlink(this,""),"href"); } else{ - PreProcessRelativeReferenceAttribute(writer,"href"); + PreProcessRelativeReference(writer,"href"); RenderAttributes(writer); } } - //FIXME: not sure about the accessor public void RaisePostBackEvent(string eventArgument){ OnServerClick(EventArgs.Empty); } @@ -49,56 +46,47 @@ namespace System.Web.UI.HtmlControls{ } } - public int HRef{ + public string HRef{ get{ string attr = Attributes["href"]; - if (attr != null){ - return attr; - } + if (attr != null) return attr; return ""; } set{ - //MapIntegerAttributeToString(value) accessible constraint is "assembly" - Attributes["href"] = MapIntegerAttributeToString(value); + Attributes["href"] = AttributeToString(value); } } public string Name{ get{ string attr = Attributes["name"]; - if (attr != null){ - return attr; - } + if (attr != null) return attr; return ""; } set{ - Attributes["name"] = MapStringAttributeToString(value); + Attributes["name"] = AttributeToString(value); } } public string Target{ get{ string attr = Attributes["target"]; - if (attr != null){ - return attr; - } + if (attr != null) return attr; return ""; } set{ - Attributes["target"] = MapStringAttributeToString(value); + Attributes["target"] = AttributeToString(value); } } public string Title{ get{ string attr = Attributes["title"]; - if (attr != null){ - return attr; - } + if (attr != null) return attr; return ""; } set{ - Attributes["title"] = MapStringAttributeToString(value); + Attributes["title"] = AttributeToString(value); } } -- cgit v1.2.3