// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
using System.Collections;
using System.Collections.Specialized;
+using System.Data;
using System.Text;
+using System.ComponentModel;
namespace System.Web.UI.WebControls {
+
+ [DefaultPropertyAttribute ("SessionField")]
public class SessionParameter : Parameter {
public SessionParameter () : base ()
{
SessionField = sessionField;
}
+
+ public SessionParameter (string name, DbType dbType, string sessionField) : base (name, dbType)
+ {
+ SessionField = sessionField;
+ }
protected override Parameter Clone ()
{
return new SessionParameter (this);
}
-
- protected override object Evaluate (Control control)
+ protected internal
+ override object Evaluate (HttpContext context, Control control)
{
- if (control == null || control.Page == null || control.Page.Session == null)
+ if (context == null || context.Session == null)
return null;
- return control.Page.Session [SessionField];
+ return context.Session [SessionField];
}
+ [DefaultValueAttribute ("")]
+ [WebCategoryAttribute ("Parameter")]
public string SessionField {
get {
string s = ViewState ["SessionField"] as string;
}
}
}
-#endif
+