app starting method

Discussion in 'ASP .Net' started by =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Mar 12, 2006.

  1. Hi;

    Is there a way to have a method called when my ASP (2.0) app is first
    loaded, before any pages are loaded?

    --
    thanks - dave
    david_at_windward_dot_net
    http://www.windwardreports.com
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Mar 12, 2006
    #1
    1. Advertising

  2. The global.asax's or HttpModules Application_start is the earliest method
    you can hook into.

    Karl

    --
    http://www.openmymind.net/



    "David Thielen" <> wrote in message
    news:...
    > Hi;
    >
    > Is there a way to have a method called when my ASP (2.0) app is first
    > loaded, before any pages are loaded?
    >
    > --
    > thanks - dave
    > david_at_windward_dot_net
    > http://www.windwardreports.com
    >
    Karl Seguin [MVP], Mar 12, 2006
    #2
    1. Advertising

  3. Thanks for Karl's informative inputs.

    Hi Dave,

    As Karl has mentioned, you can consider using the Application_Start event
    of the Global.asax. Also, this event get fired when an ASP.NET
    application's appdomain has been initialized and begin to process requests.
    However, since this event is fired only once per application, and it is not
    page or foreground UI specific, we should not put any page or request or
    front UI specific code in it.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    Steven Cheng[MSFT], Mar 13, 2006
    #3
  4. Hi;

    I understand. I use this to initialize our reporting engine - before any
    page request comes in.

    --
    thanks - dave
    david_at_windward_dot_net
    http://www.windwardreports.com



    "Steven Cheng[MSFT]" wrote:

    > Thanks for Karl's informative inputs.
    >
    > Hi Dave,
    >
    > As Karl has mentioned, you can consider using the Application_Start event
    > of the Global.asax. Also, this event get fired when an ASP.NET
    > application's appdomain has been initialized and begin to process requests.
    > However, since this event is fired only once per application, and it is not
    > page or foreground UI specific, we should not put any page or request or
    > front UI specific code in it.
    >
    > Regards,
    >
    > Steven Cheng
    > Microsoft Online Support
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Mar 13, 2006
    #4
  5. Thanks for the response Dave,

    Please feel free to post here if there is anything else we can assist.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    Steven Cheng[MSFT], Mar 14, 2006
    #5
  6. Hi;

    Every time I make a change in Global.asax then when I try to build I get the
    error message:
    Validating Web Site
    /: Build (web): Attempted to access an unloaded AppDomain.

    I have to exit and restart VS2005 to get this to stop.

    Any idea what's going on?

    --
    thanks - dave
    david_at_windward_dot_net
    http://www.windwardreports.com



    "Karl Seguin [MVP]" wrote:

    > The global.asax's or HttpModules Application_start is the earliest method
    > you can hook into.
    >
    > Karl
    >
    > --
    > http://www.openmymind.net/
    >
    >
    >
    > "David Thielen" <> wrote in message
    > news:...
    > > Hi;
    > >
    > > Is there a way to have a method called when my ASP (2.0) app is first
    > > loaded, before any pages are loaded?
    > >
    > > --
    > > thanks - dave
    > > david_at_windward_dot_net
    > > http://www.windwardreports.com
    > >

    >
    >
    >
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Apr 22, 2006
    #6
  7. Hi;

    And more - if I write some code that won't compile, then after I fix it it
    sticks with the old error message until again, I exit and restart VS2005.

    ???

    --
    thanks - dave
    david_at_windward_dot_net
    http://www.windwardreports.com



    "David Thielen" wrote:

    > Hi;
    >
    > Every time I make a change in Global.asax then when I try to build I get the
    > error message:
    > Validating Web Site
    > /: Build (web): Attempted to access an unloaded AppDomain.
    >
    > I have to exit and restart VS2005 to get this to stop.
    >
    > Any idea what's going on?
    >
    > --
    > thanks - dave
    > david_at_windward_dot_net
    > http://www.windwardreports.com
    >
    >
    >
    > "Karl Seguin [MVP]" wrote:
    >
    > > The global.asax's or HttpModules Application_start is the earliest method
    > > you can hook into.
    > >
    > > Karl
    > >
    > > --
    > > http://www.openmymind.net/
    > >
    > >
    > >
    > > "David Thielen" <> wrote in message
    > > news:...
    > > > Hi;
    > > >
    > > > Is there a way to have a method called when my ASP (2.0) app is first
    > > > loaded, before any pages are loaded?
    > > >
    > > > --
    > > > thanks - dave
    > > > david_at_windward_dot_net
    > > > http://www.windwardreports.com
    > > >

    > >
    > >
    > >
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Apr 22, 2006
    #7
  8. After we change global.asax file's code , web.config , the ASP.NET
    application's appdomain may get restarted, maybe some code is accessing
    some field in the original domain. I suggest you try manually stop the test
    webserver(if you're using VS 2005 test server to run the app), then perform
    rebuild the website and run it again to see whether it helps.

    Regards,

    Steven Cheng
    Microsoft Online Community Support


    ==================================================

    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.

    ==================================================


    This posting is provided "AS IS" with no warranties, and confers no rights.



    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    Steven Cheng[MSFT], Apr 24, 2006
    #8
  9. that did it - thanks

    --
    thanks - dave
    david_at_windward_dot_net
    http://www.windwardreports.com



    "Steven Cheng[MSFT]" wrote:

    > After we change global.asax file's code , web.config , the ASP.NET
    > application's appdomain may get restarted, maybe some code is accessing
    > some field in the original domain. I suggest you try manually stop the test
    > webserver(if you're using VS 2005 test server to run the app), then perform
    > rebuild the website and run it again to see whether it helps.
    >
    > Regards,
    >
    > Steven Cheng
    > Microsoft Online Community Support
    >
    >
    > ==================================================
    >
    > When responding to posts, please "Reply to Group" via your newsreader so
    > that others may learn and benefit from your issue.
    >
    > ==================================================
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    >
    >
    > Get Secure! www.microsoft.com/security
    > (This posting is provided "AS IS", with no warranties, and confers no
    > rights.)
    >
    >
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Apr 24, 2006
    #9
  10. You're welcome Dave,

    Regards,

    Steven Cheng
    Microsoft Online Community Support


    ==================================================

    When responding to posts, please "Reply to Group" via your newsreader so
    that others may learn and benefit from your issue.

    ==================================================


    This posting is provided "AS IS" with no warranties, and confers no rights.



    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    Steven Cheng[MSFT], Apr 25, 2006
    #10
    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. John Wright

    Starting a desktop app from ASP.NET

    John Wright, Jul 10, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    413
    Eric Sabine
    Jul 11, 2003
  2. harryos
    Replies:
    0
    Views:
    231
    harryos
    Oct 28, 2008
  3. harryos
    Replies:
    0
    Views:
    223
    harryos
    Oct 28, 2008
  4. TJ Wilkes

    Starting Method/Class issues

    TJ Wilkes, May 10, 2011, in forum: Ruby
    Replies:
    9
    Views:
    105
    7stud --
    May 11, 2011
  5. Brian Xue
    Replies:
    12
    Views:
    181
    Brian Xue
    May 17, 2011
Loading...

Share This Page