Ask a Question related to ASP.NET General, Design and Development.
-
Alvin Bruney #1
Re: Object reference scope in ASP.Net
Application.
Well for one, it's gonna behave like a global variable which means you get
to experience all the pain and issues of global variables. bad bad bad.
Secondly, even if your application is done with the object, it cannot be
garbage collected because the application still maintains a reference to it.
Why is this important, well you get to have memory sitting around not being
used and not being reclaimed. This is not scalable.
"Northern" <lifeng26@msn.com> wrote in message
news:061901c34cd6$ec1e0ad0$a401280a@phx.gbl...> I defined a public reference to an object in one of my
> module, say, ModuleA.vb. Then I instantiated the object in
> my Global.asax's Session Start event and assign it to the
> public reference I created.
>
> My question: what's the scope of this reference? session
> level, or application level? Please note here that I am
> NOT using an Session (or Application) variable. Seems like
> that it works -- I can access the value set in Global.asax
> from my ASP.Net pages. If I can do it this way, why do I
> need a Session? What's the difference here?
>
> Please help!
>
> Thanks a lot.
Alvin Bruney Guest
-
Dynamically loading user control into Placeholder gives Object reference not set to an instance of an object
I've created user controls that contain listboxes that are dynamically populated from the database. In the html view of the user control... -
Custom Control Problem :: Object reference not set to an instance of an object
Hi All! I have the following Custom Control file... '########### WebUserControl1.ascx ############# <%@ Control Language="vb"... -
[WebMethod] System.NullReferenceException: Object reference not set to an instance of an object.
Um, this isn't going to work, generally. Web services, as any web app (especially on Windows server 2003) are heavily sandboxed. The method you... -
Returning a reference to an existing C++ object as a reference
Hi All, Given: package x; sub new { return bless {}, $_; } #-- callback() is call by the C++ class (reader_as_cpp_object) #-- whenever... -
HELP! Error Loading ASPX : Object Reference not set to an instance object
Hello, When i run my aspx i get this weird error: System.NullReferenceException: Object reference not set to an instance of an object. at...



Reply With Quote

