2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mcs / class / System.Web / System.Web.UI.HtmlControls / HtmlInputControl.cs
1 /*      System.Web.UI.HtmlControls
2 *       Authors
3 *               Leen Toelen (toelen@hotmail.com)
4 */
5
6 using System;
7 using System.ComponentModel;
8 using System.Web;
9 using System.Web.UI;
10 using System.Globalization;
11
12 namespace System.Web.UI.HtmlControls
13 {
14         [ControlBuilder (typeof (HtmlControlBuilder))]
15         public abstract class HtmlInputControl : HtmlControl
16         {
17                 
18                 public HtmlInputControl (string type) : base ("input")
19                 {
20                         Attributes ["type"] = type;
21                 }
22                 
23                 protected override void RenderAttributes (HtmlTextWriter writer)
24                 {
25                         writer.WriteAttribute ("name",RenderedName);
26                         Attributes.Remove ("name");
27                         base.RenderAttributes (writer);
28                         writer.Write (" /");
29                 }
30                 
31                 [DefaultValue("")]
32                 [WebCategory("Behavior")]
33                 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
34                 public virtual string Name
35                 {
36                         get { return UniqueID; }
37                         set { }
38                 }
39                 
40                 internal virtual string RenderedName
41                 {
42                         get { return Name; }
43                 }
44
45                 [DefaultValue("")]
46                 [WebCategory("Behavior")]
47                 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
48                 public string Type
49                 {
50                         get {
51                                 string _type = Attributes ["type"];
52                                 return ((_type != null) ? _type : String.Empty);
53                         }
54                 }
55                 
56                 [DefaultValue("")]
57                 [WebCategory("Appearance")]
58                 [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
59                 public virtual string Value
60                 {
61                         get {
62                                 string attr = Attributes ["value"];
63                                 return ((attr != null) ? attr : String.Empty);
64                         }
65
66                         set { Attributes["value"] = value; }
67                 }
68         } // class HtmlInputControl
69 } // namespace System.Web.UI.HtmlControls
70