User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 456,496 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,742 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 678 | Replies: 1 | Solved
Reply
Join Date: Nov 2006
Posts: 12
Reputation: AnzJ is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
AnzJ AnzJ is offline Offline
Newbie Poster

Help how to use a custom class in a page

  #1  
Sep 21st, 2007
Hi all, need some help.

I've just built a (REALLY) simple hit counter to add to my website, and was forced to use ASP.NET. (but im not using visual studio at the moment).

I created a class file (counter.cs), and placed it in the App_Code folder. It was my assumption that by doing this, I would be able to instantiate an object of type Counter, giving me access to its methods and variables.

Problem is that as soon as I try to instantiate an object of this type, i get the error: "The type or namespace name 'Counter' could not be found".

Am I missing something here? Maybe I'm barking up the wrong tree?

Thanks!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2006
Posts: 12
Reputation: AnzJ is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
AnzJ AnzJ is offline Offline
Newbie Poster

Re: how to use a custom class in a page

  #2  
Sep 21st, 2007
Wow. All I have to say is wow.
6 hours, and a butt-load of client $$ later, I've found my error.

Its important to remember that C# is Case-sensitive. My class was defined as counter, and i was trying to instantiate an object of type "Counter". Stupid capital C.

Brock U should revoke my degree.
Thanks All.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 3:26 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC