HtmlInputControl.cs 1.5 KB

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