HtmlInputControl.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. public class HtmlInputControl : HtmlControl{
  11. public HtmlInputControl(string type):base("type"){
  12. Attributes["type"] = type;
  13. }
  14. protected virtual new void RenderAttributes(HtmlTextWriter writer){
  15. writer.WriteAttribute("name",RenderedName);
  16. Attributes.Remove("name");
  17. base.RenderAttributes(writer);
  18. writer.Write(" /");
  19. }
  20. public string Name{
  21. get{
  22. return UniqueID;
  23. }
  24. set{}
  25. }
  26. protected virtual string RenderedName{
  27. get{
  28. return Name;
  29. }
  30. }
  31. public string Type{
  32. get{
  33. string attr = Attributes["type"];
  34. if (attr != null){
  35. return attr;
  36. }
  37. return String.Empty;
  38. }
  39. }
  40. public virtual string Value{
  41. get{
  42. string attr = Attributes["value"];
  43. if (attr != null){
  44. return attr;
  45. }
  46. return String.Empty;
  47. }
  48. set{
  49. Attributes["value"] = AttributeToString(value);
  50. }
  51. }
  52. } // class HtmlInputControl
  53. } // namespace System.Web.UI.HtmlControls