Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 9th, 2008, 7:04 PM   #1
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
Question accessing classes in app_code folder

Hello All,I cant figure it out:
I started a new asp.net web application in VS Pro 2005 (herein referenced as VS2005P) and added a folder named App_code (by right clicking on the project). It looks like VS2005P was ok with it as it changed the icon for the folder to a gray folder with a thing on it.



I right clicked and added classes, but when I tried to instantiate those classes from my .aspx files it doesnt recognize them i get that error "type or namespace could not be found....."



**note the code in app_code are my business objects not my code behinds. code behinds are with the .aspx files



code for business class in app_code written by VS2005P:
namespace PropertyPhotos
{
  namespace PropertyPhotos.App_Code
  {
      public class Photos 
      {
            
           ....... code
      }

  }
}

I tried getting rid of the ".app_code" from the namespace, but no work still:
namespace PropertyPhotos
{
    public class Photos
    {
        private string _errorMessage = "";
        private string _thumbsDIR_base = Util.readFromWebConfig("thumbsDIR_base");
        private string _fullSizeDIR_base = Util.readFromWebConfig("fullSizeDIR_base");
     }
}

Here is my .aspx code - this is where i get the error:
namespace PropertyPhotos
{
    public partial class propertyPhotos : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //string propertyID = Request.QueryString["pid"];
            string propertyID = "1234";

            Photos photos = new Photos(propertyID);
               .... more code
         }
     }
}

The error:
Error	1	The type or namespace name 'Photos' could not be found (are you missing a using directive or an assembly reference?)	E:\.....\Visual Studio 2005\Projects\C21k\PropertyPhotos\PropertyPhotos\PropertyPhotos\propertyPhotos.aspx.cs
paulchwd is offline   Reply With Quote
Old Apr 9th, 2008, 7:25 PM   #2
paulchwd
Hobbyist Programmer
 
paulchwd's Avatar
 
Join Date: Mar 2005
Posts: 139
Rep Power: 4 paulchwd is on a distinguished road
Re: accessing classes in app_code folder

Fixed. It turns out that the properties for each of the files in my app_code folder had build action set to content and not compile. Thnx
paulchwd is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
code check whether a folder is empty myName C++ 6 Jun 22nd, 2006 8:58 AM
Could some please explain classes to me... TCStyle C++ 10 Feb 20th, 2006 3:51 PM
What is Lightweight C++? difference in inner classes between C++ and Java? jonyzz C++ 4 Sep 2nd, 2005 9:56 AM
List of classes Dark_Shinobi C++ 8 May 23rd, 2005 3:50 PM
Classes Sane Python 8 Apr 29th, 2005 12:50 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:30 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC