LiteralControl.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // System.Web.UI.LiteralControl.cs
  3. //
  4. // Author:
  5. // Bob Smith <[email protected]>
  6. //
  7. // (C) Bob Smith
  8. //
  9. using System;
  10. using System.ComponentModel;
  11. using System.Web;
  12. namespace System.Web.UI
  13. {
  14. [ToolboxItem(false)]
  15. public class LiteralControl : Control
  16. {
  17. private string _text = String.Empty;
  18. public LiteralControl() {}
  19. public LiteralControl(string text)
  20. {
  21. _text = text;
  22. }
  23. public virtual string Text
  24. {
  25. get
  26. {
  27. return _text;
  28. }
  29. set
  30. {
  31. _text = value;
  32. }
  33. }
  34. protected override void Render(HtmlTextWriter writer)
  35. {
  36. writer.Write(_text);
  37. }
  38. protected override ControlCollection CreateControlCollection ()
  39. {
  40. return new EmptyControlCollection (this);
  41. }
  42. }
  43. }