473,396 Members | 1,683 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

App_Code Class not working

Hello All,

I have read a few different post similiar to my situtation, but nothing
details the solution, so I will try :-)

I have two files: index.aspx and App_Code/log.vb; the log.vb file
defines a class called Log.

When my index.aspx page tries to dim an object as type Log, I always
get "Type 'Log' not defined' I get this error when I enclose the Log
class inside of a namespace as well, and @import the namespace at the
beginning of the index.aspx page.

Is there anything else, maybe a setting or a key in the web.config
file, that I have not tried or another way to do it? I have not tried
to compile the vb file into a dll file and place it in the bin
directory, but some of the posts and forums I have read state this was
not the solution either. I am running Microsoft .NET Framework
Version:2.0.50727.42 and ASP.NET Version:2.0.50727.42

Thanks for you time

Matthew

Sep 22 '06 #1
4 1725
"Log" might be reserved.

Choose another name (anyway)..

"Matthew" <ho*********@gmail.comschreef in bericht
news:11*********************@h48g2000cwc.googlegro ups.com...
Hello All,

I have read a few different post similiar to my situtation, but nothing
details the solution, so I will try :-)

I have two files: index.aspx and App_Code/log.vb; the log.vb file
defines a class called Log.

When my index.aspx page tries to dim an object as type Log, I always
get "Type 'Log' not defined' I get this error when I enclose the Log
class inside of a namespace as well, and @import the namespace at the
beginning of the index.aspx page.

Is there anything else, maybe a setting or a key in the web.config
file, that I have not tried or another way to do it? I have not tried
to compile the vb file into a dll file and place it in the bin
directory, but some of the posts and forums I have read state this was
not the solution either. I am running Microsoft .NET Framework
Version:2.0.50727.42 and ASP.NET Version:2.0.50727.42

Thanks for you time

Matthew

Sep 22 '06 #2
tr this format

Dim obj as New myNamespace.myClass
"Matthew" <ho*********@gmail.comwrote in message news:11*********************@h48g2000cwc.googlegro ups.com...
Hello All,

I have read a few different post similiar to my situtation, but nothing
details the solution, so I will try :-)

I have two files: index.aspx and App_Code/log.vb; the log.vb file
defines a class called Log.

When my index.aspx page tries to dim an object as type Log, I always
get "Type 'Log' not defined' I get this error when I enclose the Log
class inside of a namespace as well, and @import the namespace at the
beginning of the index.aspx page.

Is there anything else, maybe a setting or a key in the web.config
file, that I have not tried or another way to do it? I have not tried
to compile the vb file into a dll file and place it in the bin
directory, but some of the posts and forums I have read state this was
not the solution either. I am running Microsoft .NET Framework
Version:2.0.50727.42 and ASP.NET Version:2.0.50727.42

Thanks for you time

Matthew

Sep 22 '06 #3
Thanks for the suggestions,

Yeah, I tried those, they didn't work.

So currently it reads:

Dim theLog as New ns.MattsLog

and I still get a Type not Defined error. The thing is, VWD 2005
Express recognizes it correctly, and autocompletes it and tells me the
little summary comment I made and everything, but it is just when the
web page is run (i.e. a compilation/compile time error?) that this
occurs.

Thanks again though for the help.

Matthew

Jon Paal wrote:
tr this format

Dim obj as New myNamespace.myClass
"Matthew" <ho*********@gmail.comwrote in message news:11*********************@h48g2000cwc.googlegro ups.com...
Hello All,

I have read a few different post similiar to my situtation, but nothing
details the solution, so I will try :-)

I have two files: index.aspx and App_Code/log.vb; the log.vb file
defines a class called Log.

When my index.aspx page tries to dim an object as type Log, I always
get "Type 'Log' not defined' I get this error when I enclose the Log
class inside of a namespace as well, and @import the namespace at the
beginning of the index.aspx page.

Is there anything else, maybe a setting or a key in the web.config
file, that I have not tried or another way to do it? I have not tried
to compile the vb file into a dll file and place it in the bin
directory, but some of the posts and forums I have read state this was
not the solution either. I am running Microsoft .NET Framework
Version:2.0.50727.42 and ASP.NET Version:2.0.50727.42

Thanks for you time

Matthew
Sep 23 '06 #4
must be something else in your class code creating the "type" error
"Matthew" <ho*********@gmail.comwrote in message news:11**********************@m7g2000cwm.googlegro ups.com...
Thanks for the suggestions,

Yeah, I tried those, they didn't work.

So currently it reads:

Dim theLog as New ns.MattsLog

and I still get a Type not Defined error. The thing is, VWD 2005
Express recognizes it correctly, and autocompletes it and tells me the
little summary comment I made and everything, but it is just when the
web page is run (i.e. a compilation/compile time error?) that this
occurs.

Thanks again though for the help.

Matthew

Jon Paal wrote:
>tr this format

Dim obj as New myNamespace.myClass
"Matthew" <ho*********@gmail.comwrote in message news:11*********************@h48g2000cwc.googlegro ups.com...
Hello All,

I have read a few different post similiar to my situtation, but nothing
details the solution, so I will try :-)

I have two files: index.aspx and App_Code/log.vb; the log.vb file
defines a class called Log.

When my index.aspx page tries to dim an object as type Log, I always
get "Type 'Log' not defined' I get this error when I enclose the Log
class inside of a namespace as well, and @import the namespace at the
beginning of the index.aspx page.

Is there anything else, maybe a setting or a key in the web.config
file, that I have not tried or another way to do it? I have not tried
to compile the vb file into a dll file and place it in the bin
directory, but some of the posts and forums I have read state this was
not the solution either. I am running Microsoft .NET Framework
Version:2.0.50727.42 and ASP.NET Version:2.0.50727.42

Thanks for you time

Matthew

Sep 24 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jay Douglas | last post by:
I have a set of pages that inherit from a base class in the App_Code folder. The class looks something like: public class MyBaseClass : System.Web.UI.Page In various stages of the life cycle I...
10
by: mark.irwin | last post by:
Need help. I create a vb file in my app_code folder. Here is the code: Imports Microsoft.VisualBasic Imports System.Net.Mail Public Class email_error
2
by: walter | last post by:
Hi, when I add a new page in my asp.net 2 project and put some controls there, everything works fine until I move the code behind into App_Code folder.--When I compile , it tells me that control...
2
by: sck10 | last post by:
Hello, I created a class (public class General) with the following. My question is, is this good practice to have a group of methods(?) in one class, or should I have a separate class for each...
2
by: pradeep_TP | last post by:
Hello, I am trying to use APP_CODE folder for all my class files under VS 2005. After adding APP_CODE in the solution explorer, I added a new web page by right clicking project and selecting add...
9
by: rn5a | last post by:
Is putting a VB class file in the special directory named App_Code the same as relocating the VB class file from the App_Code directory to another directory & then using the VBC tool, compiling the...
1
by: netasp | last post by:
hi all, when adding a new web form in VS 2003, usually viewing the code behind for that form will let you write any method or function and referencing any web control placed on the form without...
0
by: TonyBushell | last post by:
Hi All, I need some help with the following: I am building a CMS to bolt onto an existing website. The CMS will be uploaded to the existing site off a folder say CMS_ADMIN/ for example. ...
5
by: Randy | last post by:
I've converted a VS 2003 project to VS 2005. I have one utility class that it put in the APP_CODE directory. When I try and compile I'm getting this error... Error 1 The type or namespace name...
1
Frinavale
by: Frinavale | last post by:
I created a custom class that inherits from the CheckBoxList. I placed the the code for this in the App_Code folder because it's used through out my web application. I ran into a namespace...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.