LiteralControl.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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.Web;
  11. namespace System.Web.UI
  12. {
  13. public class LiteralControl : Control
  14. {
  15. private string _text = String.Empty;
  16. public LiteralControl() {}
  17. public LiteralControl(string text)
  18. {
  19. _text = text;
  20. }
  21. public virtual string Text
  22. {
  23. get
  24. {
  25. return _text;
  26. }
  27. set
  28. {
  29. _text = value;
  30. }
  31. }
  32. protected override void Render(HtmlTextWriter writer)
  33. {
  34. writer.Write(_text);
  35. }
  36. protected override ControlCollection CreateControlCollection ()
  37. {
  38. return new EmptyControlCollection (this);
  39. }
  40. }
  41. }