I'm trying to implement a shared property in my C# controller where I've defined it like this:
public string guid;
public string _gu_id
{
get { return guid; }
set { guid = value; }
}
public ActionResult ActionFirst()
{
_gu_id = something...;
}
public ActionResult ActionSecond()
{
// checking now if the _gu_id is !=null
if(_gu_id!=null)
// do something here
}
Like this the property gets set in the first action but its value is not available in 2nd one...
I can declare it as static but that is not a solution as static variable should be avoided in web.. ?
Edit: To explain the problem in more details:
When the proprety _gu_id is set in first ActionFirst method, I need to be able to fetch its value in ActionSecond method, without using static variables...