2004-03-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
[mono.git] / mcs / class / System.Web / System.Web.UI / DesignerDataBoundLiteralControl.cs
1 //
2 // System.Web.UI.DesignerDataBoundLiteralControl.cs
3 //
4 // Author:
5 //   Andreas Nahr (ClassDevelopment@A-SoftTech.com)
6 //
7 // (C) 2003 Andreas Nahr
8 //
9
10 using System;
11 using System.ComponentModel;
12
13 namespace System.Web.UI
14 {
15         [ToolboxItem(false)]
16         [DataBindingHandler ("System.Web.UI.Design.TextDataBindingHandler, " + Consts.AssemblySystem_Design)]
17         public sealed class DesignerDataBoundLiteralControl : Control
18         {
19                 private string text = "";
20
21                 public DesignerDataBoundLiteralControl ()
22                 {
23                         base.PreventAutoID ();
24                 }
25
26                 public string Text {
27                         get { return text;}
28                         set {
29                                 if (value == null)
30                                         text = string.Empty;
31                                 else
32                                         text = value;
33                         }
34                 }
35
36                 protected override ControlCollection CreateControlCollection ()
37                 {
38                         return new EmptyControlCollection (this);
39                 }
40
41                 protected override void LoadViewState (object savedState)
42                 {
43                         if (savedState != null)
44                                 text = (string) savedState;
45                 }
46
47                 protected override void Render (HtmlTextWriter output)
48                 {
49                         output.Write (text);
50                 }
51
52                 protected override object SaveViewState ()
53                 {
54                         return text;
55                 }
56         }
57 }