n00b Question

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
 
J

John Timney \(ASP.NET MVP\)

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

n00b question on spacing 1
n00b question 5
N00b question: matching stuff with variables. 0
VERY n00b question 16
VERY n00b question 0
VERY n00b question 2
A simple form question 2
n00b question 4

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top