2
0

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. public abstract class HtmlInputControl : HtmlControl
  13. {
  14. public HtmlInputControl (string type) : base ("input")
  15. {
  16. Attributes ["type"] = type;
  17. }
  18. protected override void RenderAttributes (HtmlTextWriter writer)
  19. {
  20. writer.WriteAttribute ("name",RenderedName);
  21. Attributes.Remove ("name");
  22. base.RenderAttributes (writer);
  23. writer.Write (" /");
  24. }
  25. [DefaultValue("")]
  26. [WebCategory("Behavior")]
  27. [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
  28. public virtual string Name
  29. {
  30. get { return UniqueID; }
  31. set { ID = value; } // Is this ok?
  32. }
  33. protected virtual string RenderedName
  34. {
  35. get { return Name; }
  36. }
  37. [DefaultValue("")]
  38. [WebCategory("Behavior")]
  39. [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
  40. public string Type
  41. {
  42. get {
  43. string _type = Attributes ["type"];
  44. return ((_type != null) ? _type : String.Empty);
  45. }
  46. }
  47. [DefaultValue("")]
  48. [WebCategory("Appearance")]
  49. [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
  50. public virtual string Value
  51. {
  52. get {
  53. string attr = Attributes ["value"];
  54. return ((attr != null) ? attr : String.Empty);
  55. }
  56. set { Attributes["value"] = value; }
  57. }
  58. } // class HtmlInputControl
  59. } // namespace System.Web.UI.HtmlControls