Your question does not specify the technology you are using. Hence my first suggestion is based on plain C# class.
The test property is a private field and cannot be accessed outside the class. You can expose it via a property. You can make the field as internal if you are going to access it with the current assembly. Have a look at Access Modifier for more informaiton. I would suggest you to use a property as it give you more control.
private string test;
public string Test
{
get{return test;}
set{test=value'}
}
If you are using MVC then you can make use of TempData. TempData is a dictionary derived from TempDataDictionary class. It is used to store data which is only needed for the following request. For more information, refer TempData