Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.Net PAge SRC Directive - Class calling another class

Reply
Thread Tools

ASP.Net PAge SRC Directive - Class calling another class

 
 
tom@iostudios.co.uk
Guest
Posts: n/a
 
      06-11-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
 
      06-11-2007
On Jun 11, 10:11 pm, (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?


I suppose you need to add

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

 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      06-12-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)


http://www.velocityreviews.com/forums/(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
 
      06-12-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

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
src attribute of the TagPrefix Page directive Richard ASP .Net Web Controls 1 04-08-2005 01:12 AM
Q: @page directive src= guy ASP .Net 0 08-03-2004 11:42 PM
The 'Location' attribute is not supported by the 'OutPutCache' directive????when i set in the directive .NET Follower ASP .Net 1 02-13-2004 10:32 AM
@Page directive's "src=" attribute and referenceing a DLL.... Kevin Buchan ASP .Net 2 01-23-2004 03:22 PM
<@Assembly Src="" /> Directive eqvlnt in asp.net su ASP .Net 1 11-12-2003 07:22 PM



Advertisments