Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old December 17th, 2003, 10: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
  #2 (permalink)  
Old December 17th, 2003, 03: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,413
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.
  #3 (permalink)  
Old December 18th, 2003, 10: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

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 12:01 AM
Get all property values of class rrhandle ASP.NET 1.0 and 1.1 Basics 1 January 12th, 2006 04: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



All times are GMT -4. The time now is 01:27 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.