By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,969 Members | 1,522 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,969 IT Pros & Developers. It's quick & easy.

ASP.Net PAge SRC Directive - Class calling another class

P: n/a
tom
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?

Jun 11 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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" %>

Jun 11 '07 #2

P: n/a
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)
to*@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?
Jun 12 '07 #3

P: n/a
tom
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?

Jun 12 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.