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

You are currently viewing the ASP.NET 3.5 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 April 13th, 2009, 07:43 PM
Registered User
 
Join Date: Apr 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation hit counter

http://p2p.wrox.com/images/icons/icon4.gifI used SPAARJAARS.com HitCounter code (Database) in .NET 3.5 and got this error; is it because the code is meant for NET 1.1? In this case, how can I migrate the code in order to have it working? I do not poste the code because U did not touch the original

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Could not load type 'HitCounters.Global'.

Source Error:

Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="HitCounters.Global" %>

Source File: /copyItallser/global.asax Line: 1
 
Old April 14th, 2009, 08:18 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 166
Thanks: 2
Thanked 33 Times in 33 Posts
Default

Yes, .NET 2 and 3.5 are different to 1.1 and do not pick up the CodeBehind as you would expect by default .

The easiest thing to do is just put your Global.asax.cs within the App_Code folder then remove the CodeBehind attribute.
So Global.asax will contain:

asp Code:
<%@ Application Inherits="HitCounters.Global" %>

and Global.asax.cs should look like:
csharp Code:
using System;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;

namespace HitCounters
{
    public partial class Global
        : System.Web.HttpApplication
    {
        // ... methods ...
    }
}

HTH
Phil





Similar Threads
Thread Thread Starter Forum Replies Last Post
A Hit Counter, PLEASE HELP !!!!! ARD_40 BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 April 23rd, 2006 06:25 AM
hit counter gumgak Classic ASP Basics 2 November 2nd, 2003 12:44 AM
Hit Counter mateenmohd HTML Code Clinic 7 September 28th, 2003 07:22 AM





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