PC Review


Reply
Thread Tools Rate Thread

ASP.Net PAge SRC Directive - Class calling another class

 
 
tom@iostudios.co.uk
Guest
Posts: n/a
 
      11th Jun 2007
My clients hosting company (BT!!) will not allow pre-compiled code so
I am having to use the src page directive. I thought this wouldnt eb
a big problem! Bit mistake. However, I am getting there.

I have the following setup and the items are called one after another:

default.aspx - My Page!
default.vb - My Codebhind page (accessed via the src directive)
clsBLL - My Business Logic Layer
clsData - My Data Layer

I have added the following to default.aspx:

<%@ Import Namespace="System.Data" %>
<%@ Assembly Src="clsData.vb" %>
<%@ Assembly Src="clsBLL.vb" %>
<%@ Page src="default.aspx.vb" Inherits="_2CDesign._default"%>

However; whenever I run default.aspx I get the following error:

BC30002: Type 'clsData' is not defined.

Its almost like I need to add a <%@ Assembly Src="clsData.vb" %> line
of code into clsBLL, how do I do this? Or how do I let clsBLL see
clsData?

 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      11th Jun 2007
On Jun 11, 10:11 pm, t...@iostudios.co.uk wrote:
> My clients hosting company (BT!!) will not allow pre-compiled code so
> I am having to use the src page directive. I thought this wouldnt eb
> a big problem! Bit mistake. However, I am getting there.
>
> I have the following setup and the items are called one after another:
>
> default.aspx - My Page!
> default.vb - My Codebhind page (accessed via the src directive)
> clsBLL - My Business Logic Layer
> clsData - My Data Layer
>
> I have added the following to default.aspx:
>
> <%@ Import Namespace="System.Data" %>
> <%@ Assembly Src="clsData.vb" %>
> <%@ Assembly Src="clsBLL.vb" %>
> <%@ Page src="default.aspx.vb" Inherits="_2CDesign._default"%>
>
> However; whenever I run default.aspx I get the following error:
>
> BC30002: Type 'clsData' is not defined.
>
> Its almost like I need to add a <%@ Assembly Src="clsData.vb" %> line
> of code into clsBLL, how do I do this? Or how do I let clsBLL see
> clsData?


I suppose you need to add

<%@ Assembly Name="clsData" %>
<%@ Assembly Name="clsBLL" %>

 
Reply With Quote
 
bruce barker
Guest
Posts: n/a
 
      12th Jun 2007
if you are using 2.0, then put the shared code file in the app_code
folder. thats all you need to do.

-- bruce (sqlwork.com)


(E-Mail Removed) wrote:
> My clients hosting company (BT!!) will not allow pre-compiled code so
> I am having to use the src page directive. I thought this wouldnt eb
> a big problem! Bit mistake. However, I am getting there.
>
> I have the following setup and the items are called one after another:
>
> default.aspx - My Page!
> default.vb - My Codebhind page (accessed via the src directive)
> clsBLL - My Business Logic Layer
> clsData - My Data Layer
>
> I have added the following to default.aspx:
>
> <%@ Import Namespace="System.Data" %>
> <%@ Assembly Src="clsData.vb" %>
> <%@ Assembly Src="clsBLL.vb" %>
> <%@ Page src="default.aspx.vb" Inherits="_2CDesign._default"%>
>
> However; whenever I run default.aspx I get the following error:
>
> BC30002: Type 'clsData' is not defined.
>
> Its almost like I need to add a <%@ Assembly Src="clsData.vb" %> line
> of code into clsBLL, how do I do this? Or how do I let clsBLL see
> clsData?
>

 
Reply With Quote
 
tom@iostudios.co.uk
Guest
Posts: n/a
 
      12th Jun 2007
I have done that now I am getting the following error in my class when
I try and run it

Type 'Exception' is not defined.

I have added the following to the top of my page

<%@ Import Namespace="System" %>

Why can my class not see this? I also got an error on the IsNothing
function but I changed that to variable is nothing? Weird eh?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
calling java class from web page =?Utf-8?B?VkIgSm9ubmll?= Microsoft ASP .NET 8 11th Jul 2007 01:30 PM
Base class calling derived class methods Mike C# Microsoft VC .NET 8 14th Sep 2006 08:51 PM
calling method from one class without declaring the class again?? c#2006user Microsoft C# .NET 3 22nd Mar 2006 10:59 PM
InitializeComponent is generating the wrong code for my custom class. Calling it's base class constructor jrhoads23@hotmail.com Microsoft Dot NET Framework Forms 0 1st Feb 2005 07:10 PM
How to Get Calling Page Name from Library Class JezB Microsoft ASP .NET 1 21st May 2004 11:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:37 AM.