Running a referance

Discussion in 'ASP .Net' started by Zulander, Aug 16, 2006.

  1. Zulander

    Zulander Guest

    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
    Zulander, Aug 16, 2006
    #1
    1. Advertising

  2. 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)


    --
    Co-founder, Eggheadcafe.com developer portal:
    http://www.eggheadcafe.com
    UnBlog:
    http://petesbloggerama.blogspot.com




    "Zulander" wrote:

    > 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
    >
    >
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=, Aug 16, 2006
    #2
    1. Advertising

  3. Zulander

    Kumar Reddi Guest

    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..


    Zulander wrote:
    > 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
    Kumar Reddi, Aug 16, 2006
    #3
  4. Zulander

    Zulander Guest

    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


    Peter wrote:
    > 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)
    >
    >
    > --
    > Co-founder, Eggheadcafe.com developer portal:
    > http://www.eggheadcafe.com
    > UnBlog:
    > http://petesbloggerama.blogspot.com
    >
    >
    >
    >
    > "Zulander" wrote:
    >
    > > 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
    > >
    > >
    Zulander, Aug 16, 2006
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CES
    Replies:
    0
    Views:
    327
  2. =?Utf-8?B?SSBhbSBTYW0=?=

    Null Referance Exception

    =?Utf-8?B?SSBhbSBTYW0=?=, Mar 17, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    448
    Karl Seguin
    Mar 17, 2005
  3. =?Utf-8?B?SSBhbSBTYW0=?=

    I am having huge problems with a null referance

    =?Utf-8?B?SSBhbSBTYW0=?=, Mar 17, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    357
    =?Utf-8?B?SSBhbSBTYW0=?=
    Mar 18, 2005
  4. Matt

    generic object referance

    Matt, Apr 14, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    321
  5. =?Utf-8?B?U2FjaGk=?=

    Need to pull out referance details

    =?Utf-8?B?U2FjaGk=?=, Sep 2, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    324
    =?Utf-8?B?Q2xpbnQgSGlsbA==?=
    Sep 2, 2005
Loading...

Share This Page