473,749 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem referencing other classes from ASP.NET code behind class

I have a page called admin.aspx and it uses admin.aspx.cs as it's code behind
file.
When developing the application on my localhost using VS.NET i reference
thsi file using codebehind="adm in.aspx.cs". I now have to upload it to a
production server which i have no control over and has no bin directory (and
i cannot create one) to place the project dll assemblies in to.

I have now changed the file to use the src attricbute so the files are
compiled on the fly using JIT and do not require the dll:

<%@ Page language="c#" src="admin.aspx .cs" AutoEventWireup ="false"
Inherits="vox.a dmin" %>

When the admin.aspx is called it runs but I get the followign error:

Compiler Error Message: CS0234: The type or namespace name 'dataLayerAcces s'
does not exist in the class or namespace 'vox' (are you missing an assembly
reference?)

Source Error:
line 27: private vox.dataLayerAc cess db;

The problem occurs on my localhost as well if i remove the bin directory.
The problem is that the code behind class cannot find other classes which are
in the same directory. Is there a way of giving the admin.aspx.cs class a
reference to the location of where the other class is vox.dataLayerAc cess.cs
as admin.aspx can find admin.aspx.cs using src=acmin.aspx. cs?

Note i have tried to remove the namespace vox and the error still occurs.
Any ideas would be apprciated as i cannot get a bin directory on the web
server i am deploying too.

Thanks

Ian

Nov 19 '05 #1
4 1417
On Fri, 18 Feb 2005 05:23:03 -0800, "Ian Meakin"
<Ia*******@disc ussions.microso ft.com> wrote:
I have a page called admin.aspx and it uses admin.aspx.cs as it's code behind
file.
When developing the application on my localhost using VS.NET i reference
thsi file using codebehind="adm in.aspx.cs". I now have to upload it to a
production server which i have no control over and has no bin directory (and
i cannot create one) to place the project dll assemblies in to.


Ask them to make a bin folder, can't see that would put many people
out. You have FTP access but can't create folders?

I

--
Iain Norman | http://www.eliteforum.org
Nov 19 '05 #2
I can create folders but the directory is not setup as a virtual directory so
it the files when executed will not look in the bin directory created. Thats
why i dont want to use a bin directory and want to use src as the
administartor will not change the server.

"Iain Norman" wrote:
On Fri, 18 Feb 2005 05:23:03 -0800, "Ian Meakin"
<Ia*******@disc ussions.microso ft.com> wrote:
I have a page called admin.aspx and it uses admin.aspx.cs as it's code behind
file.
When developing the application on my localhost using VS.NET i reference
thsi file using codebehind="adm in.aspx.cs". I now have to upload it to a
production server which i have no control over and has no bin directory (and
i cannot create one) to place the project dll assemblies in to.


Ask them to make a bin folder, can't see that would put many people
out. You have FTP access but can't create folders?

I

--
Iain Norman | http://www.eliteforum.org

Nov 19 '05 #3
If your application folder is not setup as a virtual directory, you will
likely fall into many more problems than this.

As you seem to know, using src= instead of codebehind= in the @Page
directive should solve the immediate problem for you.

Joshua Flanagan
http://flimflan.com/blog
Ian Meakin wrote:
I can create folders but the directory is not setup as a virtual directory so
it the files when executed will not look in the bin directory created. Thats
why i dont want to use a bin directory and want to use src as the
administartor will not change the server.

"Iain Norman" wrote:

On Fri, 18 Feb 2005 05:23:03 -0800, "Ian Meakin"
<Ia*******@di scussions.micro soft.com> wrote:

I have a page called admin.aspx and it uses admin.aspx.cs as it's code behind
file.
When developing the application on my localhost using VS.NET i reference
thsi file using codebehind="adm in.aspx.cs". I now have to upload it to a
production server which i have no control over and has no bin directory (and
i cannot create one) to place the project dll assemblies in to.


Ask them to make a bin folder, can't see that would put many people
out. You have FTP access but can't create folders?

I

--
Iain Norman | http://www.eliteforum.org

Nov 19 '05 #4
Ian maybe use inline coding..
For example use WebMatrix and that could solver ur problem for now.
Hope it helps!
Patrick
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #5

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

Similar topics

11
2810
by: Milind | last post by:
Hi, I was trying to implement a composition relation, somthing of the following type: class A { public: class B {
12
1961
by: Mark Broadbent | last post by:
Hi guys, just going through remoting at the moment and a couple of questions relating to .net in general has surfaced. Firstly I have seen in the designer that for the namespace and many of its associated classes of System.Runtime.Remoting are available, but certain ones are not. A reference to System.Runtime.Remoting needs to be added to make available all the unavailable ones. Now although I (think) understand the concept that an...
5
3047
by: | last post by:
Hi, I'm trying to use the cookie munging session handling behaviour of asp.net instead of cookies themselves as I'm finding quite a few people are barring cookies (especially AOL users). If I change the setting in web.config everything seems to work fine as long as I'm using relative paths. The problem is I've got a menuing system that's generated from a site-wide template - so I use a fixed path from the application root - (ie:...
2
1778
by: Mike Taylor | last post by:
I'm trying to create a base page class for my project (am new to ASP.NET, so am a bit stumped) - I'm using VS.NET 2003, btw. OK, my dummy base page class is shown below: using System; using System.Web; using System.Web.UI; using System.Web.Security; using System.Security.Principal;
7
1635
by: Patrick | last post by:
Hi all, I was playing around with ASP.Net 2.0 and recognized that in case you use Code-Behind/Beside (how is it called in future?) the parser still creates TWO classes one partial class under the global namespace which is called the same way than your codebehind class and another class under ASP namespace which is called the way you named your ASPX file (using underscores instead of dots). It's not enough, it playces the files you...
1
1636
by: Mike | last post by:
Hello, I am attempting to develop a class that will inherit from System.Web.UI.Page to serve as a the base class for all of the code behind classes in my web application. I would like to store the class as a single file (basepage.cs) and not in an assembly. (The class does not have access to the ASP.NET Request Object or Server object when stored as an assebly). How do I go about referencing this class? Is there a way to add it to...
2
1257
by: Alan Silver | last post by:
Hello, I have a user control that has one .cs file, with several .ascx files that call it. The reason for this is that I can pick whichever of the ..ascx files I want (based on a site owner setting), and I know the code-behind is the same in all cases. That way the .ascx file can be picked dynamically, allowing the appearance of the page to be changed based on a user setting. This was working fine in 1.1, but had the code-behind...
11
2118
by: Daylor | last post by:
hi. im using option strict on. im doing in ,from the simple reason ,to be warn when there are implict conversion like string to int ,int to string. BUT. the price ,(now i see ), is very bad. if i have class CCar and interface ICar when im doing this : ICar = new CCar
8
1503
by: Chris | last post by:
Hi, i have in an content page a fieldset containing a label, an iframe and a textarea: <asp:Content ID="Content1" ContentPlaceHolderID="main" Runat="Server"> <fieldset style="width:650px;"> <asp:Label ID="Label1" runat="server"></asp:Label> <iframe ..... ></iframe> <textarea id="txta" rows="6"></textarea>
0
8833
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9389
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9335
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6801
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4709
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3320
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 we have to send another system
2
2794
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2218
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.