Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 8th, 2009, 02:14 PM
Registered User
 
Join Date: Mar 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Global.asax has the wrong code

I'm writing my first ASP.NET application and following the instructions in Wrox book I added the Global Application Class. However, when I open it, the C# code looks nothing like the sample in the book. All I have is two events - the Application_Start and Application_End. No session events where I can add (global) variables to my session. Any ideas ?
 
Old March 8th, 2009, 03:04 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Can't you just type the method signatures you want right into the class, like Session_Start, Session_End, and so on?
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
 
Old March 8th, 2009, 05:34 PM
Registered User
 
Join Date: Mar 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks. I did actually think about that but was curious why VS 2005 had presented me with a different script. I wondered whether it was some parameter setting in VS.
 
Old March 8th, 2009, 06:18 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

I think the template that creates that class is probably different among various versions of VS.
__________________
Visit my blog at http://leedumond.com
Follow me on Twitter: http://twitter.com/LeeDumond

Code:
if (this.PostHelpedYou)
{
   ClickThanksButton(); 
}
 
Old March 9th, 2009, 08:09 AM
Registered User
 
Join Date: Mar 2009
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Found the problem. I created the project using Create in the Start Page and configured it as an ASP.NET 2.0 application. In fact I should have gone to File > New and created it as a web site. Thanks.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to declare the global variable in global.asax? calyn_gately ASP.NET 3.5 Basics 0 August 6th, 2008 08:06 PM
VB version Global.asax missing some code Scott663 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 March 29th, 2007 02:23 PM
In my Global asax file aDo I need the code below n kenn_rosie VS.NET 2002/2003 0 April 11th, 2006 12:17 AM
what is global.asax? gaurav_jain2403 General .NET 1 February 3rd, 2006 02:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.