Click here to Skip to main content
15,742,150 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have a property which stores session value in .cs file .
I want to access that property in another class file in same solution but different project.

eg:

in .cs file i am saving session value as :
C#
public Int16 Year
{
   get
   {
       if session(year) == null)
         new Int16());
       return Convert.ToInt16(session(year));
   }
   set
   {
      session(year)  , value);
   }
}

I want to access this property in another class file in different project in same solution.

What I have tried:

i tried pagename.propertyname . what shoul i try
Posted
v2
Comments

1 solution

YourNamespace.YourClass x = new YourNamespace.YourClass();
Int16 year = x.Year;


You'll have to use the correct namespace and classname, and the project will need a reference to the project that the class is in.
 
Share this answer
 
v2

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