Is it possible to set value to variable in httpmodule and read the value of the variable in contentpage & masterpage?
I want to use this instead of session. The variable holds the value of the userID.
Because every page on my site creates a number of different database connections i think that one more is better than having session values?! What do you think?
I want to create a site that can grow large. (Always tries to program my sites in this way) So thats why I want to take away a number of session values.
Thanks!
Mattias.
you can use below Code snippet.....
//Store data in Step1:
HttpContext.Current.Items.Add("Key", "Value");
//Retrieve data in Step2:
object value = HttpContext.Current.Items["Key"];
For more detail... Read these articles.
http://www.shubho.net/2011/01/using-httpcontextcurrentitems-as-data.html