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.


in .cs file i am saving session value as :
public Int16 Year
       if session(year) == null)
         new Int16());
       return Convert.ToInt16(session(year));
      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

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

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