The browser has absolutely nothing to do with it. The server has no way of
knowing when a browser closes. In fact, by the time the browser even gets
the page, the server has already finished its processing and has
disconnected from the client.
All of your object variables will fall out of scope when the page finishes
its server-side processing. The objects themselves will remain in memory
until the Garbage Collector cleans up the heap.
Your problem sounds more like your are caching some results somewhere and
the server is reusing those results for new page requests.
Hi Scott, thanks for your reply. I'm not caching the sortedlist such as in a
session object, so how can it be reused by the server?
It's declared in a module:
Module mdlGeneral
Public Itinerary As SortedList
End Module
Then it is instantiated and used in a click event:
Private Sub btnAddToItinerary_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnAddToItinerary.Click
'Create the object if necessary.
If Itinerary Is Nothing Then
Itinerary = New SortedList
End If
'Look for the issue id first. Add it if not already in the sortedlist.
If
Itinerary.ContainsKey(Session("ServiceIssueDetailIssueID").ToString) = False
Then
Itinerary.Add(Session("ServiceIssueDetailIssueID").ToString,
Session("ServiceIssueDetailIssueDescription").ToString)
End If
End Sub
> The browser has absolutely nothing to do with it. The server has no way of
> knowing when a browser closes. In fact, by the time the browser even gets
[quoted text clipped - 42 lines]
> > Thank you,
> > Richard
Scott M. - 30 Apr 2005 00:02 GMT
Why are you declaring it in a module? That's your problem. Itinerary is
never going to be nothing as long as the web application is running. Just
declare and instantiate it in the web page. If you need to persist it
between different pages consider caching it or passing it between pages.
> Hi Scott, thanks for your reply. I'm not caching the sortedlist such as in
> a
[quoted text clipped - 82 lines]
>> > Thank you,
>> > Richard