Z
Zdravko Stefanov
I have globally declared instance of a .NET CLASS in global.asax. The
declaration goes like this:
<object id="GlobalVar" runat="server" scope="application"
class="MyNamespace.CMyClass" />
I am trying to use it like this in code:
GlobalVar.DoSomething();
but receive error "The type or namespace name 'GlobalVar' could not be found
(are you missing a using directive or an assembly reference?)"
This way of usage was possible in ASP 3.0 and I thought it is possible in
ASP.NET too... Am I wrong? Now I can use the object only as
Application.StaticObjects["GlobalVar"]....
TIA
declaration goes like this:
<object id="GlobalVar" runat="server" scope="application"
class="MyNamespace.CMyClass" />
I am trying to use it like this in code:
GlobalVar.DoSomething();
but receive error "The type or namespace name 'GlobalVar' could not be found
(are you missing a using directive or an assembly reference?)"
This way of usage was possible in ASP 3.0 and I thought it is possible in
ASP.NET too... Am I wrong? Now I can use the object only as
Application.StaticObjects["GlobalVar"]....
TIA