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

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaurav Vaish <gvaish@mono-cvs.ximian.com>2002-01-24 07:14:05 +0300
committerGaurav Vaish <gvaish@mono-cvs.ximian.com>2002-01-24 07:14:05 +0300
commitb259284dc22e8630c7efbfc4a8ce7c526b609d41 (patch)
tree11e00febff25635a0e09b3a2a9d591a9b99e8a95 /mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs
parente0971fd9f40cfa9b3979668771f79bca78d7b710 (diff)
2002-24-02 Gaurav Vaish <gvaish@iitk.ac.in>
* *.cs -- Updates from Leen Toelen (toelen@hotmail.com) svn path=/trunk/mcs/; revision=2142
Diffstat (limited to 'mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs')
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs194
1 files changed, 99 insertions, 95 deletions
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 bd319d61b54..8d8a4787198 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs
@@ -1,95 +1,99 @@
-/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlAnchor : HtmlContainerControl, IPostBackEventHandler{
-
- 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);
- }
-
- protected new void RenderAttributes(HtmlTextWriter writer){
- if ( (EventHandler) Events[EventServerClick] != null){
- Attributes.Remove("href");
- RenderAttributes(writer);
- writer.WriteAttribute(Page.GetPostBackClientHyperlink(this,""),"href");
- }
- else{
- PreProcessRelativeReference(writer,"href");
- RenderAttributes(writer);
- }
- }
-
- public void RaisePostBackEvent(string eventArgument){
- OnServerClick(EventArgs.Empty);
- }
-
- public event EventHandler ServerClick{
- add{
- Events.AddHandler(EventServerClick, value);
- }
- remove{
- Events.RemoveHandler(EventServerClick, value);
- }
- }
-
- public string HRef{
- get{
- string attr = Attributes["href"];
- if (attr != null) return attr;
- return "";
- }
- set{
- Attributes["href"] = AttributeToString(value);
- }
- }
-
- public string Name{
- get{
- string attr = Attributes["name"];
- if (attr != null) return attr;
- return "";
- }
- set{
- Attributes["name"] = AttributeToString(value);
- }
- }
-
- public string Target{
- get{
- string attr = Attributes["target"];
- if (attr != null) return attr;
- return "";
- }
- set{
- Attributes["target"] = AttributeToString(value);
- }
- }
-
- public string Title{
- get{
- string attr = Attributes["title"];
- if (attr != null) return attr;
- return "";
- }
- set{
- Attributes["title"] = AttributeToString(value);
- }
- }
-
- } // class HtmlAnchor
-} // namespace System.Web.UI.HtmlControls
-
+/* System.Web.UI.HtmlControls
+* Authors
+* Leen Toelen (toelen@hotmail.com)
+*/
+
+using System;
+using System.Web;
+using System.Web.UI;
+
+namespace System.Web.UI.HtmlControls{
+
+ public class HtmlAnchor : HtmlContainerControl, IPostBackEventHandler{
+
+ private static readonly object EventServerClick;
+
+ static HtmlAnchor(){
+ EventServerClick = new Object();
+ }
+
+ public HtmlAnchor(): base("a"){}
+
+ protected virtual void OnServerClick(EventArgs e){
+ EventHandler handler;
+ handler = (EventHandler) Events[EventServerClick];
+ if(handler != null) handler.Invoke(this, e);
+ }
+
+ protected new void RenderAttributes(HtmlTextWriter writer){
+ if ( Events[EventServerClick] != null){
+ Attributes.Remove("href");
+ base.RenderAttributes(writer);
+ writer.WriteAttribute("href", Page.GetPostBackClientHyperlink(this,String.Empty));
+ }
+ else{
+ PreProcessRelativeReference(writer,"href");
+ RenderAttributes(writer);
+ }
+ }
+
+ void System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(string eventArgument){
+ OnServerClick(EventArgs.Empty);
+ }
+
+ public event EventHandler ServerClick{
+ add{
+ Events.AddHandler(EventServerClick, value);
+ }
+ remove{
+ Events.RemoveHandler(EventServerClick, value);
+ }
+ }
+
+ public string HRef{
+ get{
+ string attr = Attributes["href"];
+ if (attr != null) return attr;
+ return String.Empty;
+ }
+ set{
+ Attributes["href"] = AttributeToString(value);
+ }
+ }
+
+ public string Name{
+ get{
+ string attr = Attributes["name"];
+ if (attr != null) return attr;
+ return String.Empty;
+ }
+ set{
+ Attributes["name"] = AttributeToString(value);
+ }
+ }
+
+ public string Target{
+ get{
+ string attr = Attributes["target"];
+ if (attr != null) return attr;
+ return String.Empty;
+ }
+ set{
+ Attributes["target"] = AttributeToString(value);
+ }
+ }
+
+ public string Title{
+ get{
+ string attr = Attributes["title"];
+ if (attr != null) return attr;
+ return String.Empty;
+ }
+ set{
+ Attributes["title"] = AttributeToString(value);
+ }
+ }
+
+ } // class HtmlAnchor
+} // namespace System.Web.UI.HtmlControls
+