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 {
17 protected SessionParameter (SessionParameter original) : base (original)
19 this.SessionField = original.SessionField;
22 public SessionParameter (string name, string sessionField) : base (name)
24 SessionField = sessionField;
27 public SessionParameter (string name, TypeCode type, string sessionField) : base (name, type)
29 SessionField = sessionField;
32 protected override Parameter Clone ()
34 return new SessionParameter (this);
37 protected override object Evaluate (Control control)
39 if (control == null || control.Page == null || control.Page.Session == null)
42 return control.Page.Session [SessionField];
45 public string SessionField {
47 string s = ViewState ["SessionField"] as string;
54 if (SessionField != value) {
55 ViewState ["SessionField"] = value;
56 OnParameterChanged ();