2 // System.Web.UI.WebControls.SessionParameter
5 // Ben Maurer (bmaurer@users.sourceforge.net)
11 using System.Collections;
12 using System.Collections.Specialized;
15 namespace System.Web.UI.WebControls {
16 public class SessionParameter : Parameter {
18 public SessionParameter () : base ()
22 protected SessionParameter (SessionParameter original) : base (original)
24 this.SessionField = original.SessionField;
27 public SessionParameter (string name, string sessionField) : base (name)
29 SessionField = sessionField;
32 public SessionParameter (string name, TypeCode type, string sessionField) : base (name, type)
34 SessionField = sessionField;
37 protected override Parameter Clone ()
39 return new SessionParameter (this);
42 protected override object Evaluate (Control control)
44 if (control == null || control.Page == null || control.Page.Session == null)
47 return control.Page.Session [SessionField];
50 public string SessionField {
52 string s = ViewState ["SessionField"] as string;
59 if (SessionField != value) {
60 ViewState ["SessionField"] = value;
61 OnParameterChanged ();