Running a referance

Z

Zulander

Hi,
i have a DLL that i have made, I need the page to keep it running until
the sesssion has ended.
When the users logs in using webcontrol login, i create the object when
the user has loged in but for some reason the object closes and does
not keep running, i know it starts up but it stop's for some reason !!



Partial Class Login
Inherits System.Web.UI.Page
Dim Monitor As FileMonitor.Monitor
Protected Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Login1.LoggedIn
Dim Monitor As New FileMonitor.Monitor
Monitor.tEnabled = True
End Sub
End Class

thnak you
 
G

Guest

Try storing it in Session State if it is user-specific, or Cache or
Application State if used for ever visitor.

Dim Monitor As New FileMonitor.Monitor
Monitor.tEnabled = True
Session("monitor")=Monitor


to retrieve:

Dim Monitor as FileMonitor.Monitor = DirectCast(Session("monitor"),
FileMonitor.Monitor)
 
K

Kumar Reddi

What do you mean by, the object does not keep running?

Remember, asp.net is a stateless technology, once a request is
completed, all the objects are gone. If you want to persist some data
then you need to use some state bags, like Session or Cache or
Application memories..
 
Z

Zulander

Peter,
When you say i need to save it in a session should i still up i in the
Protected Sub Login1_LoggedIn?


This is my actual code:
rotected Sub Login1_LoggedIn(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Login1.LoggedIn
Dim Monitor As New FileMonitor.Monitor
dim Userdir as string

Monitor.Interval = 5000
Monitor.TimeOut = 1
Monitor.DefaultDir = "C:\Inetpub\wwwroot\test\Temp\"
Userdir = Monitor.GeneratedDir
Monitor.tEnabled = True
Session("monitor") = Monitor
end sub

i am still fairly new to asp.net, i know asp!
thank you
 

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

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top