How to access global.asax values in class file
-
Hi, I am using .net 2.0. I created a class file "condb.cs" in my website. I declared a variable in Globale.asax. I can access that value in first.aspx.cs page and i can't access that value in condb.cs file. Please help me to retrieve the global value in .cs file. Thanks.
-
Hi, I am using .net 2.0. I created a class file "condb.cs" in my website. I declared a variable in Globale.asax. I can access that value in first.aspx.cs page and i can't access that value in condb.cs file. Please help me to retrieve the global value in .cs file. Thanks.
Why not to use application variables? like:
Application[key] = value;
Intelligence is almost useless for those who have nothing else! Email: caiokf@gmail.com
-
Why not to use application variables? like:
Application[key] = value;
Intelligence is almost useless for those who have nothing else! Email: caiokf@gmail.com
-
Hi, Application variables can be used in aspx.cs files only. I have to access it in a separate .cs file. So, now I used HttpContext to access that global variable. If you know some other methods for that please refer me. Thanks.
Application variables can be accessed in separate .cs files using:
HttpContext.Current.Application[key]
Intelligence is almost useless for those who have nothing else! Email: caiokf@gmail.com
-
Application variables can be accessed in separate .cs files using:
HttpContext.Current.Application[key]
Intelligence is almost useless for those who have nothing else! Email: caiokf@gmail.com