Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 17th, 2003, 11:41 AM
Authorized User
 
Join Date: Dec 2003
Location: , , USA.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to AyatKh
Default Access to a property in the class.

Hi,
I have a class (securityClass)in the session Object (SecurityObj) that has a property called LoggedIn which is boolean. I need to check if that property of SecurityObj in the session is True or False.
Could you please Suggest a solution.
thanks
Ayat
 
Old December 17th, 2003, 04:10 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Your question is a little confusing, but I'll take a stab at it. I think what you are saying is that you have an instance (named "SecurityObj") of your securityClass class that is living in the Session collection and you need to check a property on it. I'll make the assumption the keyname used in the Session collection is "SecurityObj". The session collection returns everything as an object so you need to convert it.

VB:
Dim objSecurity As securityClass
objSecurity = CType(Session("SecurityObj"), securityClass)
objSecurity.LoggedIn

You can shortcut it this way:
CType(Session("SecurityObj"), securityClass).LoggedIn

C# (I think):
securityClass objSecurity;
objSecurity = (securityClass) Session("SecurityObj");
objSecurity.LoggedIn


Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 18th, 2003, 11:25 AM
Authorized User
 
Join Date: Dec 2003
Location: , , USA.
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to AyatKh
Default

Thanks Peter,
It helped me a lot! It was the first time that I got a feedback online.
Ayat





Similar Threads
Thread Thread Starter Forum Replies Last Post
LockType Property of the RecordSet Class dslagle2 Excel VBA 1 August 22nd, 2007 01:37 PM
Property access from Class within Partial Class zoltac007 C# 2005 0 December 1st, 2006 01:01 AM
Get all property values of class rrhandle ASP.NET 1.0 and 1.1 Basics 1 January 12th, 2006 05:13 PM
Project.Class.Property. ? Jstmehr4u3 VB How-To 4 June 11th, 2003 03:10 PM
Project.Class.Property.? Jstmehr4u3 Pro VB 6 2 June 11th, 2003 11:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.