Click here to Skip to main content
15,886,639 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have a ASP.NET project and A class on Login after Authenticating the Accounts I store the Info to a getter/setter and save all of them on a List then after I redirect the pages according to users designation I'll fetch the Data of my List so that it can be used in my methods. hope you can help me..

I didn't like to used session because it doesn't fit my style. hope you'll understand :)

VB
Public Class UserInfo
' Property containing Information of user
End Class


//Class that will hold the data of UserInfo which will be used for other Class/Pages
Public Class UserInformation

Public Sub New()
_UserInfo = New List(Of UserInfo)
End Sub

Private _UserInfo As List(Of UserInfo)
Public Property UserDetails() As List(Of UserInfo)
Get
Return _UserInfo
End Get
Set(ByVal value As List(Of UserInfo))
_UserInfo = value
End Set
End Property
End Class
Posted
Updated 26-Oct-13 0:19am
v3

actuallu you are to fetch object value that you set one page and then creating another object on another page trying to get value ..
you can get values either passing that object to another page on which you want to access values.
Or user session


For you knowledge if you are creating two object on one page and after setting values on one object if you will try to access those by another object of the same you will get nothing.
each object initialzed to seprate block of memory.

Hope this helps!!
 
Share this answer
 
Comments
iMaker.ph 26-Oct-13 7:13am    
hmm
how about this
OnSubmitButton
Dim UserInfo As New UserInfo
Passing the variable to Userinfo Properties like
UserInfo.Firstname
UserInfo.username
UserInfo.contact
and then pass this Class to a Property which is List of UserInfo

Dim userInformation As UserInformation
UserInformation.getUserInfo.Add(UserInfo)
in this state the data on UserInfo are now on userInformation

now If I go to MainMenu.aspx and Declaire UserInformation I will get nothing?
iMaker.ph 26-Oct-13 7:14am    
"passing that object to another page" How can I used this without Session?
One solution i am having what you can do is declare all property as static and then assign direct values like YouClass.YouStaticProperty=Yourvalue
After redirecting to another there you can fetch values directly by using YouClass.YouStaticProperty

remeber dont create object now .

Hope This Helps!!!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900