473,320 Members | 1,744 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,320 software developers and data experts.

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 1112
<%@ 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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.