n00b Question

  • Thread starter Thread starter Ambush
  • Start date Start date
A

Ambush

I'm pretty new to ASP.NET programming and web programming in general,
but I've been a client/server programmer for several years now (which
is definately making things more difficult for me). I've got a project
developed in ASP.NET designed, for the most part, the way that I would
design a client/server app. As light a front end as I can make, and
the real workhorse code in the back end. What I'm running in to is
that sometimes (and I can't really nail this down) my variables are not
re-initializing in between runs. In the dev env., I might set a
boolean value, stop the project, re-run, and check the value
immediately, and it's the old value, not the re-initialized variable.
The only major thing that I can think of is that the variables that
aren't re-initialize are in modules, rather than page level variables.
Could they be not unloading properly/at all? Is this normal? Is there
any way for me to change this behavior if that is the case?

Thanks
 
If you set a value on the server then it may well be available at the next
page request, as the server runtime holds the value not your application.
To drop all variables then you would need to restart the web application,
not the application (the pages) that you are coding.

However this is all dependent on how you load and store your variables. Try
to stay away from static variables, or modules holding variables that are
loading at anything but page level as these are likey to remain in scope on
the web server even though you have stopped your page equest.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 
Back
Top