ASP.Net PAge SRC Directive - Class calling another class

Discussion in 'ASP .Net' started by tom@iostudios.co.uk, Jun 11, 2007.

  1. Guest

    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, 2007
    #1
    1. Advertising

  2. On Jun 11, 10:11 pm, 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" %>
    Alexey Smirnov, Jun 11, 2007
    #2
    1. Advertising

  3. bruce barker Guest

    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)


    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?
    >
    bruce barker, Jun 12, 2007
    #3
  4. Guest

    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, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. su
    Replies:
    1
    Views:
    497
    Chris Jackson
    Nov 12, 2003
  2. Kevin Buchan
    Replies:
    2
    Views:
    2,088
    Kevin Buchan
    Jan 23, 2004
  3. guy

    Q: @page directive src=

    guy, Aug 4, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    334
  4. Steve Richter

    <txt src= ...> equivalent of <img src= ...>

    Steve Richter, Feb 8, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    2,061
    Laurent Bugnion
    Feb 9, 2006
  5. Richard

    src attribute of the TagPrefix Page directive

    Richard, Apr 7, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    164
    Brock Allen
    Apr 8, 2005
Loading...

Share This Page