diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2002-06-06 15:38:30 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2002-06-06 15:38:30 +0400 |
commit | 99f37626e5822b70478798202f4a0c4542c52926 (patch) | |
tree | 840e28f64a82f98a068af4491ce3bf1d147df8cb /mcs/class/System.Web/System.Web.UI.HtmlControls | |
parent | edd9d283a8da406ca1f02cbae0b726d77048289b (diff) |
2002-06-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* System.Web.UI/Page.cs: for each child control to render, assign
Control.Page. Probably also needed in HtmlContainerControl derived
classes.
* System.Web.UI.HtmlControls/HtmlControl.cs: Render contents moved to
new RenderBeginTag method, defined in MS docs.
* System.Web.UI.HtmlControls/HtmlForm.cs: Render output when no IE
browser.
* System.Web.UI.HtmlControls/HtmlInputButton.cs: added constructor
without arguments. Xsp used it, though now it always use the other
.ctor.
* System.Web.UI.HtmlControls/HtmlInputControl.cs: cosmetic changes and
implemented set_Name.
svn path=/trunk/mcs/; revision=5135
Diffstat (limited to 'mcs/class/System.Web/System.Web.UI.HtmlControls')
5 files changed, 105 insertions, 97 deletions
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog index d5a0b7868df..a8298ec24d2 100644 --- a/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog +++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/ChangeLog @@ -1,3 +1,15 @@ +2002-06-06 Gonzalo Paniagua Javier <gonzalo@ximian.com> + + * HtmlControl.cs: Render contents moved to new RenderBeginTag method, + defined in MS docs. + + * HtmlForm.cs: Render output when no IE browser. + + * HtmlInputButton.cs: added constructor without arguments. Xsp used it, + though now it always use the other .ctor. + + * HtmlInputControl.cs: cosmetic changes and implemented set_Name. + 2002-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com> * HtmlButton.cs: RenderAttributes is an override, not new. 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 aa3f19f2ae3..4907fabd9fd 100644 --- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs +++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlControl.cs @@ -63,12 +63,17 @@ namespace System.Web.UI.HtmlControls{ Attributes[name] = value;
}
- protected override void Render (HtmlTextWriter writer)
+ protected virtual void RenderBeginTag (HtmlTextWriter writer)
{
writer.WriteBeginTag (TagName);
RenderAttributes (writer);
writer.Write ('>');
}
+
+ protected override void Render (HtmlTextWriter writer)
+ {
+ RenderBeginTag (writer);
+ }
protected virtual void RenderAttributes(HtmlTextWriter writer){
if (ID != null){
@@ -79,35 +84,23 @@ namespace System.Web.UI.HtmlControls{ public AttributeCollection Attributes
{
- get
- {
- return _attributes;
- }
+ get { return _attributes; }
}
+
public bool Disabled
{
- get
- {
- return _disabled;
- }
- set
- {
- _disabled = value;
- }
+ get { return _disabled; }
+ set { _disabled = value; }
}
+
public CssStyleCollection Style
{
- get
- {
- return _attributes.CssStyle;
- }
+ get { return _attributes.CssStyle; }
}
+
public virtual string TagName
{
- get
- {
- return _tagName;
- }
+ get { return _tagName; }
}
}
}
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs index 8b670da189e..70d3bb54755 100644 --- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs +++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlForm.cs @@ -38,22 +38,24 @@ namespace System.Web.UI.HtmlControls{ base.RenderAttributes(writer);
}
- //TODO: adapt code for non-IE browsers
protected override void Render(HtmlTextWriter output){
- if (Page.SmartNavigation == true){
- ((IAttributeAccessor) this).SetAttribute("_smartNavigation","true");
- HttpBrowserCapabilities browserCap = Context.Request.Browser;
- if (browserCap.Browser.ToLower() != "ie" && browserCap.MajorVersion < 5){
- base.Render(output);
- return;
- }
- output.WriteLine("<IFRAME ID=_hifSmartNav NAME=_hifSmartNav STYLE=display:none ></IFRAME>");
-
- if (browserCap.MinorVersion < 0.5 && browserCap.MajorVersion != 5)
- Page.RegisterClientScriptFile("SmartNavIncludeScript","JScript","SmartNavIE5.js");
- else if (Page.IsPostBack) Page.RegisterClientScriptFile("SmartNavIncludeScript","JScript","SmartNav.js");
+ if (Page.SmartNavigation == false){
+ base.Render (output);
+ return;
+ }
+
+ ((IAttributeAccessor) this).SetAttribute("_smartNavigation","true");
+ HttpBrowserCapabilities browserCap = Context.Request.Browser;
+ if (browserCap.Browser.ToLower() != "ie" && browserCap.MajorVersion < 5){
base.Render(output);
+ return;
}
+ output.WriteLine("<IFRAME ID=_hifSmartNav NAME=_hifSmartNav STYLE=display:none ></IFRAME>");
+
+ if (browserCap.MinorVersion < 0.5 && browserCap.MajorVersion != 5)
+ Page.RegisterClientScriptFile("SmartNavIncludeScript","JScript","SmartNavIE5.js");
+ else if (Page.IsPostBack) Page.RegisterClientScriptFile("SmartNavIncludeScript","JScript","SmartNav.js");
+ base.Render(output);
}
protected override void RenderChildren(HtmlTextWriter writer){
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 48be001756c..d9e371a7f8a 100755 --- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs +++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputButton.cs @@ -14,6 +14,10 @@ namespace System.Web.UI.HtmlControls{ private static readonly object EventServerClick;
+ public HtmlInputButton(): base ("button")
+ {
+ }
+
public HtmlInputButton(string type): base(type){}
protected void OnServerClick(EventArgs e){
diff --git a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs index 5c5010d4451..56b7759040e 100755 --- a/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs +++ b/mcs/class/System.Web/System.Web.UI.HtmlControls/HtmlInputControl.cs @@ -1,63 +1,60 @@ -/* System.Web.UI.HtmlControls
-* Authors
-* Leen Toelen (toelen@hotmail.com)
-*/
-
-using System;
-using System.Web;
-using System.Web.UI;
-using System.Globalization;
-
-namespace System.Web.UI.HtmlControls{
-
- public class HtmlInputControl : HtmlControl{
-
- public HtmlInputControl(string type):base("type"){
- Attributes["type"] = type;
- }
-
- protected virtual new void RenderAttributes(HtmlTextWriter writer){
- writer.WriteAttribute("name",RenderedName);
- Attributes.Remove("name");
- base.RenderAttributes(writer);
- writer.Write(" /");
- }
-
- public string Name{
- get{
- return UniqueID;
- }
- set{}
- }
-
- protected virtual string RenderedName{
- get{
- return Name;
- }
- }
-
- public string Type{
- get{
- string attr = Attributes["type"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- }
-
- public virtual string Value{
- get{
- string attr = Attributes["value"];
- if (attr != null){
- return attr;
- }
- return String.Empty;
- }
- set{
- Attributes["value"] = AttributeToString(value);
- }
- }
- } // class HtmlInputControl
-} // namespace System.Web.UI.HtmlControls
-
+/* System.Web.UI.HtmlControls +* Authors +* Leen Toelen (toelen@hotmail.com) +*/ + +using System; +using System.Web; +using System.Web.UI; +using System.Globalization; + +namespace System.Web.UI.HtmlControls +{ + + public class HtmlInputControl : HtmlControl + { + + public HtmlInputControl (string type) : base ("type") + { + Attributes ["type"] = type; + } + + protected override void RenderAttributes (HtmlTextWriter writer) + { + writer.WriteAttribute ("name",RenderedName); + Attributes.Remove ("name"); + base.RenderAttributes (writer); + writer.Write (" /"); + } + + public virtual string Name + { + get { return UniqueID; } + set { ID = value; } // Is this ok? + } + + protected virtual string RenderedName + { + get { return Name; } + } + + public string Type + { + get { + string _type = Attributes ["type"]; + return ((_type != null) ? _type : String.Empty); + } + } + + public virtual string Value + { + get { + string attr = Attributes ["value"]; + return ((attr != null) ? attr : String.Empty); + } + + set { Attributes["value"] = value; } + } + } // class HtmlInputControl +} // namespace System.Web.UI.HtmlControls + |