HtmlInputControl.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* System.Web.UI.HtmlControls
  2. * Authors
  3. * Leen Toelen ([email protected])
  4. */
  5. using System;
  6. using System.Web;
  7. using System.Web.UI;
  8. using System.Globalization;
  9. namespace System.Web.UI.HtmlControls
  10. {
  11. public class HtmlInputControl : HtmlControl
  12. {
  13. public HtmlInputControl (string type) : base ("input")
  14. {
  15. Attributes ["type"] = type;
  16. }
  17. protected override void RenderAttributes (HtmlTextWriter writer)
  18. {
  19. writer.WriteAttribute ("name",RenderedName);
  20. Attributes.Remove ("name");
  21. base.RenderAttributes (writer);
  22. writer.Write (" /");
  23. }
  24. public virtual string Name
  25. {
  26. get { return UniqueID; }
  27. set { ID = value; } // Is this ok?
  28. }
  29. protected virtual string RenderedName
  30. {
  31. get { return Name; }
  32. }
  33. public string Type
  34. {
  35. get {
  36. string _type = Attributes ["type"];
  37. return ((_type != null) ? _type : String.Empty);
  38. }
  39. }
  40. public virtual string Value
  41. {
  42. get {
  43. string attr = Attributes ["value"];
  44. return ((attr != null) ? attr : String.Empty);
  45. }
  46. set { Attributes["value"] = value; }
  47. }
  48. } // class HtmlInputControl
  49. } // namespace System.Web.UI.HtmlControls