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:
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2002-06-04 20:49:33 +0400
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2002-06-04 20:49:33 +0400
commitf1b29831f994a09249fb041c9894d5caabe1fdf5 (patch)
tree2f6b402a765b9850e7b5d4fb7601c7b249c5b36e /mcs/class/System.Web/System.Web.UI.HtmlControls
parent22f23b9995e6170eeadd6bfce4278ebc22651119 (diff)
2002-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* System.Web.UI/Control.cs: don't throw exception in ControlID. By now, it returns ID. * System.Web.UI/Page.cs: (ProcessRequest): implemented. * System.Web.UI.HtmlControls/HtmlAnchor.cs: (RenderAttributes): new -> override and fixed little bug that made it cause an stack overflow. * System.Web.UI.HtmlControls/HtmlContainerControl.cs: reformatted and added tag and its attributes rendering. * System.Web.UI.HtmlControls/HtmlGenericControl.cs: removed TagName, which is already in HtmlControl. * System.Web.UI.HtmlControls/HtmlTable.cs: (RenderEndTag): new -> override. svn path=/trunk/mcs/; revision=5117
Diffstat (limited to 'mcs/class/System.Web/System.Web.UI.HtmlControls')
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog15
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs4
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs172
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs9
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs2
5 files changed, 107 insertions, 95 deletions
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
index df1e190fbcf..237b9ca1571 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
@@ -1,3 +1,18 @@
+2002-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * HtmlAnchor.cs:
+ (RenderAttributes): new -> override and fixed little bug that made
+ it cause an stack overflow.
+
+ * HtmlContainerControl.cs: reformatted and added tag and attributes
+ rendering.
+
+ * HtmlGenericControl.cs: removed TagName, which is already in
+ HtmlControl.
+
+ * HtmlTable.cs:
+ (RenderEndTag): new -> override.
+
2002-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* System.Web.UI.HtmlControls/HtmlForm.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 8d8a4787198..f469b7ee1c2 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlAnchor.cs
@@ -25,7 +25,7 @@ namespace System.Web.UI.HtmlControls{
if(handler != null) handler.Invoke(this, e);
}
- protected new void RenderAttributes(HtmlTextWriter writer){
+ protected override void RenderAttributes(HtmlTextWriter writer){
if ( Events[EventServerClick] != null){
Attributes.Remove("href");
base.RenderAttributes(writer);
@@ -33,7 +33,7 @@ namespace System.Web.UI.HtmlControls{
}
else{
PreProcessRelativeReference(writer,"href");
- RenderAttributes(writer);
+ base.RenderAttributes(writer);
}
}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs
index 41f3b8046c8..6f063a51102 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs
@@ -1,83 +1,89 @@
-//
-// System.Web.UI.HtmlControls.HtmlContainerControl.cs
-//
-// Author
- // Bob Smith <bob@thestuff.net>
- //
- // (C) Bob Smith
- //
-
- using System;
- using System.Web;
- using System.Web.UI;
-
- //LAMESPEC: The dox talk about HttpException but are very ambigious.
- //TODO: Check to see if Render really is overridden instead of a LiteralControl being added. It apears that this is the
- //case due to testing. Anything inside the block is overwritten by the content of this control, so it doesnt apear
- //to do anything with children.
- // a doc references this. add? protected override ControlCollection CreateControlCollection();
-
- //TODO: If Test.InnerText = Test.InnerHtml without ever assigning anything into InnerHtml, you get this:
- // Exception Details: System.Web.HttpException: Cannot get inner content of Message because the contents are not literal.
- //[HttpException (0x80004005): Cannot get inner content of Message because the contents are not literal.]
- // System.Web.UI.HtmlControls.HtmlContainerControl.get_InnerHtml() +278
- // ASP.test3_aspx.AnchorBtn_Click(Object Source, EventArgs E) in \\genfs2\www24\bobsmith11\test3.aspx:6
- // System.Web.UI.HtmlControls.HtmlAnchor.OnServerClick(EventArgs e) +108
- // System.Web.UI.HtmlControls.HtmlAnchor.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +26
- // System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
- // System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +149
- // System.Web.UI.Page.ProcessRequestMain() +660
-
-
- namespace System.Web.UI.HtmlControls
- {
- public abstract class HtmlContainerControl : HtmlControl{
-
- private string _innerHtml = String.Empty;
- private string _innerText = String.Empty;
- private bool _doText = false;
- private bool _doChildren = true;
- protected string _tagName;
-
- public HtmlContainerControl() : base(){}
-
- public HtmlContainerControl(string tag) : base(tag) {}
-
- public virtual string InnerHtml
- {
- get
- {
- return _innerHtml;
- }
- set
- {
- _innerHtml = value;
- _doText = false;
- _doChildren = false;
- }
- }
-
- public virtual string InnerText
- {
- get
- {
- return _innerText;
- }
- set
- {
- _innerText = value;
- _doText = true;
- _doChildren = false;
- }
- }
-
- protected override void Render(HtmlTextWriter writer)
- {
- if(_doChildren) RenderChildren(writer);
- else if(_doText) Page.Server.HtmlEncode(_innerText, writer);
- else writer.Write(_innerHtml);
- }
-
- protected virtual void RenderEndTag(HtmlTextWriter writer){}
- }
- }
+//
+// System.Web.UI.HtmlControls.HtmlContainerControl.cs
+//
+// Author
+// Bob Smith <bob@thestuff.net>
+//
+// (C) Bob Smith
+//
+
+using System;
+using System.Web;
+using System.Web.UI;
+
+//LAMESPEC: The dox talk about HttpException but are very ambigious.
+//TODO: Check to see if Render really is overridden instead of a LiteralControl being added. It apears that this is the
+//case due to testing. Anything inside the block is overwritten by the content of this control, so it doesnt apear
+//to do anything with children.
+// a doc references this. add? protected override ControlCollection CreateControlCollection();
+
+//TODO: If Test.InnerText = Test.InnerHtml without ever assigning anything into InnerHtml, you get this:
+// Exception Details: System.Web.HttpException: Cannot get inner content of Message because the contents are not literal.
+//[HttpException (0x80004005): Cannot get inner content of Message because the contents are not literal.]
+// System.Web.UI.HtmlControls.HtmlContainerControl.get_InnerHtml() +278
+// ASP.test3_aspx.AnchorBtn_Click(Object Source, EventArgs E) in \\genfs2\www24\bobsmith11\test3.aspx:6
+// System.Web.UI.HtmlControls.HtmlAnchor.OnServerClick(EventArgs e) +108
+// System.Web.UI.HtmlControls.HtmlAnchor.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +26
+// System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
+// System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +149
+// System.Web.UI.Page.ProcessRequestMain() +660
+
+
+namespace System.Web.UI.HtmlControls
+{
+ public abstract class HtmlContainerControl : HtmlControl{
+
+ private string _innerHtml = String.Empty;
+ private string _innerText = String.Empty;
+ private bool _doText = false;
+ private bool _doChildren = true;
+
+ public HtmlContainerControl() : base(){}
+
+ public HtmlContainerControl(string tag) : base(tag) {}
+
+ public virtual string InnerHtml
+ {
+ get
+ {
+ return _innerHtml;
+ }
+ set
+ {
+ _innerHtml = value;
+ _doText = false;
+ _doChildren = false;
+ }
+ }
+
+ public virtual string InnerText
+ {
+ get
+ {
+ return _innerText;
+ }
+ set
+ {
+ _innerText = value;
+ _doText = true;
+ _doChildren = false;
+ }
+ }
+
+ protected override void Render(HtmlTextWriter writer)
+ {
+ writer.WriteBeginTag (TagName);
+ RenderAttributes (writer);
+ writer.Write ('>');
+ if(_doChildren) RenderChildren(writer);
+ else if(_doText) Page.Server.HtmlEncode(_innerText, writer);
+ else writer.Write(_innerHtml);
+ RenderEndTag (writer);
+ }
+
+ protected virtual void RenderEndTag (HtmlTextWriter writer)
+ {
+ writer.WriteEndTag (TagName);
+ }
+ }
+}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs
index 2583de6190b..619ad693642 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlGenericControl.cs
@@ -19,14 +19,5 @@
public HtmlGenericControl(string tag): base(tag){}
- public new string TagName {
- get
- {
- return _tagName;
- }
- set{
- _tagName = value;
- }
- }
}
}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs
index db057fd16ff..800b64a0bc8 100755
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlTable.cs
@@ -26,7 +26,7 @@ namespace System.Web.UI.HtmlControls{
writer.Indent = writer.Indent - 1;
}
- protected new void RenderEndTag(HtmlTextWriter writer){
+ protected override void RenderEndTag(HtmlTextWriter writer){
base.RenderEndTag(writer);
writer.WriteLine();
}