I wanted to pass the Session object to a method but received an error message:
A property or indexer may not be passed as an out or ref parameter
int result = something.ValidateUser("someIP","someuser","somepass","somemodule", ref Session, out ErrorText);
Alright. So I tried this:
int result = something.ValidateUser("someIP","someuser","somepass","somemodule", Session, out ErrorText);
Which I accepted like this:
public int ValidateUser(string UserHostAddress, string UserName, string UserPassword, string ServiceCode, System.Web.SessionState.HttpSessionState MySession, out string ErrorText)
MySession["my_incredibly_precious_variable"] = "some value";
And then, outside this method, in my main:
Session["my_incredibly_precious_variable"] was indeed holding "some value".
How is this possible? And most importatnly: is this PROPER?
I couldn't pass Session as a reference or out, so I'm not sure I should be doing this?
Thanks in advance!