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-05 19:58:32 +0400
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2002-06-05 19:58:32 +0400
commit62aeab6dc17ed33644f8da189b788c2339648f4e (patch)
treea40651d92c5bc9a05863363b71e21edd87634584 /mcs/class/System.Web/System.Web.UI.HtmlControls
parenta6e91ebb095fc3eb19b6350972bf5361353dd18c (diff)
2002-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* System.Web.UI/AttributeCollection.cs: don't need a Hastable. StateBag now works fine and takes care of the details. * System.Web.UI/Control.cs: added HasChildren property. * System.Web.UI/StateBag.cs: fixed a couple of nasty bugs. * System.Web.UI.HtmlControls/HtmlButton.cs: RenderAttributes is an override, not new. * System.Web.UI.HtmlControls/HtmlContainerControl.cs: use the new Render method in HtmlControl. * System.Web.UI.HtmlControls/HtmlControl.cs: added Render method to render the tag and its attributes. Works for container and non-containers. * System.Web.UI.HtmlControls/HtmlImage.cs: RenderAttributes don't need to be new. Implemented Height property. svn path=/trunk/mcs/; revision=5130
Diffstat (limited to 'mcs/class/System.Web/System.Web.UI.HtmlControls')
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog12
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlButton.cs8
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs4
-rw-r--r--mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs39
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs17
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs31
-rwxr-xr-xmcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs12
7 files changed, 37 insertions, 86 deletions
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
index 465d0492174..d5a0b7868df 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog
@@ -1,5 +1,17 @@
2002-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+ * HtmlButton.cs: RenderAttributes is an override, not new.
+
+ * HtmlContainerControl.cs: use the new Render method in HtmlControl.
+
+ * HtmlControl.cs: added Render method to render the tag and its
+ attributes. Works for container and non-containers.
+
+ * HtmlImage.cs: RenderAttributes don't need to be new. Implemented
+ Height property.
+
+2002-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
* HtmlContainerControl.cs: some formatting and use HttpUtility.Encode
instead of Page.Server to encode InnerText.
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlButton.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlButton.cs
index 640daf02fef..b926ef0f184 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlButton.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlButton.cs
@@ -29,13 +29,9 @@ namespace System.Web.UI.HtmlControls{
}
}
- protected new void RenderAttributes(HtmlTextWriter writer){
+ protected override void RenderAttributes(HtmlTextWriter writer){
if (Page != null && Events[EventServerClick] != null){
- WriteOnClickAttribute(
- writer,
- false,
- true,
- CausesValidation == false? Page.Validators.Count > 0: false);
+ /* Got to figure out how to manage events */
}
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 a2e67b44e26..970a48aced9 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlContainerControl.cs
@@ -64,9 +64,7 @@ namespace System.Web.UI.HtmlControls
protected override void Render(HtmlTextWriter writer)
{
- writer.WriteBeginTag (TagName);
- RenderAttributes (writer);
- writer.Write ('>');
+ base.Render (writer);
if (_doChildren)
RenderChildren(writer);
else if (_doText)
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs
index 09e90e20274..aa3f19f2ae3 100644
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs
@@ -63,6 +63,13 @@ namespace System.Web.UI.HtmlControls{
Attributes[name] = value;
}
+ protected override void Render (HtmlTextWriter writer)
+ {
+ writer.WriteBeginTag (TagName);
+ RenderAttributes (writer);
+ writer.Write ('>');
+ }
+
protected virtual void RenderAttributes(HtmlTextWriter writer){
if (ID != null){
writer.WriteAttribute("id",ClientID);
@@ -70,38 +77,6 @@ namespace System.Web.UI.HtmlControls{
Attributes.Render(writer);
}
- internal void WriteOnClickAttribute(HtmlTextWriter writer, bool submitsAutomatically, bool submitsProgramatically, bool causesValidation) {
- string local1;
- string local2;
- string local3;
-
- AttributeCollection attr = Attributes;
- local1 = null;
- if (submitsAutomatically) {
- if ((causesValidation))
- local1 = System.Web.UI.Utils.GetClientValidatedEvent(Page);
- }
- else if (submitsProgramatically) {
- if (causesValidation)
- local1 = System.Web.UI.Utils.GetClientValidatedPostBack(this);
- else
- local1 = Page.GetPostBackClientEvent(this, String.Empty);
- }
- if (local1 != null) {
- local2 = attr["language"];
- if (local2 != null)
- attr.Remove("language");
- writer.WriteAttribute("language", "javascript");
- local3 = attr["onclick"];
- if (local3 != null) {
- attr.Remove("onclick");
- writer.WriteAttribute("onclick", local3 + " " + local1);
- return;
- }
- writer.WriteAttribute("onclick", local1);
- }
- }
-
public AttributeCollection Attributes
{
get
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs
index 62135016d4c..a0ca1f13b3b 100755
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlImage.cs
@@ -14,9 +14,9 @@ namespace System.Web.UI.HtmlControls{
public HtmlImage(): base("img"){}
- protected new void RenderAttributes(HtmlTextWriter writer){
+ protected override void RenderAttributes(HtmlTextWriter writer){
PreProcessRelativeReference(writer,"src");
- RenderAttributes(writer);
+ base.RenderAttributes(writer);
writer.Write(" /");
}
@@ -59,6 +59,19 @@ namespace System.Web.UI.HtmlControls{
}
}
+ public int Height
+ {
+ get {
+ string attr = Attributes ["height"];
+ if (attr != null)
+ return Int32.Parse (attr, CultureInfo.InvariantCulture);
+
+ return -1;
+ }
+
+ set { Attributes["height"] = AttributeToString (value); }
+ }
+
public string Src{
get{
string attr = Attributes["src"];
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs
index 3f1a75c4133..48be001756c 100755
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs
@@ -23,37 +23,6 @@ namespace System.Web.UI.HtmlControls{
}
}
- protected override void RenderAttributes(HtmlTextWriter writer){
- string attrType = Type;
- bool ofTypeSubmit = (String.Compare(attrType, "submit", true) == 0);
- bool events;
- if (ofTypeSubmit != true){
- events = (Events[EventServerClick] != null);
- }
- else{
- events = false;
- }
- if (Page != null){
- if (ofTypeSubmit != true){
- WriteOnClickAttribute(
- writer,
- false,
- true,
- CausesValidation == false? Page.Validators.Count > 0: false);
- }
- else{
- if (events != true && String.Compare(attrType,"button", true) != 0){
- WriteOnClickAttribute(
- writer,
- false,
- true,
- CausesValidation == false? Page.Validators.Count > 0: false);
- }
- }
- }
- base.RenderAttributes(writer);
- }
-
public void RaisePostBackEvent(string eventArgument){
if(CausesValidation == true){
Page.Validate();
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs
index a8a45da640d..1854a3b4dd2 100755
--- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs
+++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputImage.cs
@@ -29,18 +29,6 @@ namespace System.Web.UI.HtmlControls{
// if (handler != null) handler.Invoke(this, e);
}
- protected override void RenderAttributes(HtmlTextWriter writer){
- PreProcessRelativeReference(writer,"src");
- if (Page != null && !CausesValidation){
- WriteOnClickAttribute(
- writer,
- false,
- true,
- CausesValidation == false? Page.Validators.Count > 0: false);
- }
- RenderAttributes(writer);
- }
-
public bool LoadPostData(string postDataKey, NameValueCollection postCollection){
string postX = postCollection[String.Concat(RenderedName,".x")];
string postY = postCollection[String.Concat(RenderedName,".y")];