app starting method

G

Guest

Hi;

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

Karl Seguin [MVP]

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

Karl
 
S

Steven Cheng[MSFT]

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

Guest

Hi;

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

Steven Cheng[MSFT]

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

Guest

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
 
S

Steven Cheng[MSFT]

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

Steven Cheng[MSFT]

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

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

No members online now.

Forum statistics

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