473,466 Members | 1,451 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Namespace not found in aspx but IS found in code behind

I have a class library that I built which I have added a reference to using
the Add Reference option.

Within my C# webform1.aspx I get a compile error with the following line
stating that the type or namespace was found and asking if I'm missing a
reference:
<% MyNamespace.MyObj abc; %>

However if I place this same line within the webform1.aspx.cs (code behind
page), say in the Page_Load event then it WORKS FINE.
MyNamespace.MyObj abc;

So, what would be different that would cause the aspx to error out at
compile time when running the page for the first time, compared to
everything working perfectly if I do the same code from the code behind
page? All this of course is within the same project and I definately do
have a reference to the class library where MyNamespace.MyObj is defined.
In case it matters this is with Framework 1.0 and VS.NET 2002.

Thanks!!
Nov 18 '05 #1
1 1117
<%@ import namespace="value"%> (NB the space)

See
http://msdn.microsoft.com/library/en...asp?frame=true


"William Parker" <wi*****@nonospam.com> wrote in message
news:CZ********************@comcast.com...
I have a class library that I built which I have added a reference to using the Add Reference option.

Within my C# webform1.aspx I get a compile error with the following line
stating that the type or namespace was found and asking if I'm missing a
reference:
<% MyNamespace.MyObj abc; %>

However if I place this same line within the webform1.aspx.cs (code behind
page), say in the Page_Load event then it WORKS FINE.
MyNamespace.MyObj abc;

So, what would be different that would cause the aspx to error out at
compile time when running the page for the first time, compared to
everything working perfectly if I do the same code from the code behind
page? All this of course is within the same project and I definately do
have a reference to the class library where MyNamespace.MyObj is defined.
In case it matters this is with Framework 1.0 and VS.NET 2002.

Thanks!!

Nov 18 '05 #2

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

Similar topics

6
by: Pete | last post by:
Hi, I am writing a pre-handler page for aspx pages, in which I want to call a custom method on the code-behind class file for the aspx page. In order to do this I need to somehow get the...
0
by: | last post by:
I'm trying to use a namespace i've created but i keep getting a compile error at runtime. Here's the files and problem i'm having. Any ideas? index.aspx // file with html, etc index_CB.cs //...
1
by: William Parker | last post by:
I have a class library that I built which I have added a reference to using the Add Reference option. Within my C# webform1.aspx I get a compile error with the following line stating that the...
4
by: Stephen Cochran | last post by:
I'm getting the following error in my ASP.NET application: Namespace or type 'DirectoryServices' for the Imports 'System.DirectoryServices' cannot be found. I have added the...
29
by: Natan | last post by:
When you create and aspx page, this is generated by default: using System; using System.Collections; using System.Collections.Specialized; using System.Configuration; using System.Text; using...
6
by: antonyliu2002 | last post by:
Hi, guys, I am using Visual Web Developer Express 2005 for my web application. I wrote a simple class called MyTestClass.cs and put it in the App_Code folder. I compiled it to library from...
11
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a machine Windows Server 2003 using IIS 6.0 and I am getting the error BC30560 prjob_ascx is ambiguous in the namespace ASP I found a fix. Deleting all the files in the...
0
by: RN1 | last post by:
The following code resides in a user-control (UCProperties.ascx) ------------------------------------------- <%@ Control Language="VB" Inherits="UCPropertiesNS.UCProperties"...
0
by: =?Utf-8?B?dG9ycA==?= | last post by:
I am working with the sample shopping cart code from Stephen Walther's book "ASP.NET 2.0 unleashed" which I changed for an app I am buiding. The problem I have is fairly simple. I have to call a...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.