Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't view code in Global.asax...

Status
Not open for further replies.

isarta

Programmer
May 15, 2007
8
EE
Hello,

I'm beginer programer in C# and I need help:

I'm using Visual Studio 2005. I wanted to add Global.asax to my WebSite-> ASP.net Web Site.

I used Solution Explorer -> Add new Item -> Global Application Class. But, there was no Global.asax.cs. Such function as View Code wasn't too. I found in web that F7 can open code too, but no result. :(

Please help me. What I did wrong and how to "View Code" in Global.asax?

Thank you.
 
there isn't a code behind for asax. (same with ashx without some manual syntax) just put the code directly in the global.asax file.

the global.asax file is used to fire gobal events. application start, session start, on error, session end, application end, request begin... those kinds of events.

if you want to add code that is accessible through out your application place this code in a new code file in the App_Code directory. then create a new instance of the object when needed.

P.S. there is a forum dedicated specifically to asp.net (language egnostic) [] use this for future web questions.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top