Module Not Found

Discussion in 'ASP .Net' started by Jim Heavey, Oct 27, 2003.

  1. Jim Heavey

    Jim Heavey Guest

    I am trying to figure out the @Assembly directive.

    I have an application which uses "codebehind" and only
    uses source code, so I
    am using the "src=" option of the @Page directive. So I
    have something that
    looks like the following:

    ASPX Files ASPX.VB Files
    Page1.aspx Page1.aspx.vb
    Page2.aspx Page2.aspx.vb
    Page3.aspx Page3.aspx.vb

    Now all of these three pages have a common program, let's
    call it "Common.vb"
    which is called from Page1.aspx.vb, Page2.aspx.vb,
    Page2.aspx.vb.

    When I run using the @Page src="Pag1.aspx.vb"
    inherits="Page1", when
    Page1.aspx.vb instatiates the "Common.vb" I get a compile
    error indicating
    that the class can not be found.

    If I copy "Common.vb" and append it to "Page1.aspx.vb"...
    then no problem, it
    works just fine.

    I am trying to find a way to enable these pages to
    find "Common.vb" without me
    having to copy the source into each of these pages.

    I have taken to "Common.vb" and created a seperate
    project, and compiled it
    and placed the code in the "bin" folder, but still not
    luck.

    Looking at the @Assembly option, it would appear to me
    that this may allow the
    assembly to be found, but no matter what I put into this
    directive, even
    garbage, it has not effect. It has a "src=" option which
    indicates that the
    specified program will be compiled on the fly.

    So any ideas as to what I need to do to enable the program
    to be found and
    compiled on the fly? Or for that matter, found in
    the "bin" folder? Although
    I believe it will look in the "Bin" folder for
    the "folder" which is
    identified as an "application folder" and unfortuneatly
    the folder that I am
    executing from is not an application folder and nor do I
    have access to the
    folder which is the application folder to place my
    compiled program into.

    Your assistance would be greatly appreciated!!!!!!!!!!!
     
    Jim Heavey, Oct 27, 2003
    #1
    1. Advertising

  2. Jim Heavey

    Stephan Bour Guest

    If you want to use classes that are part of a compiled assembly you need an
    Import declaration at the top of your aspx page, as opposed to Inherits:
    <%@ Import Namespace="MyComponent" %>

    in article 0abd01c39ccb$ffc0deb0$, Jim Heavey at
    wrote on 10/27/03 15:50:

    > I am trying to figure out the @Assembly directive.
    >
    > I have an application which uses "codebehind" and only
    > uses source code, so I
    > am using the "src=" option of the @Page directive. So I
    > have something that
    > looks like the following:
    >
    > ASPX Files ASPX.VB Files
    > Page1.aspx Page1.aspx.vb
    > Page2.aspx Page2.aspx.vb
    > Page3.aspx Page3.aspx.vb
    >
    > Now all of these three pages have a common program, let's
    > call it "Common.vb"
    > which is called from Page1.aspx.vb, Page2.aspx.vb,
    > Page2.aspx.vb.
    >
    > When I run using the @Page src="Pag1.aspx.vb"
    > inherits="Page1", when
    > Page1.aspx.vb instatiates the "Common.vb" I get a compile
    > error indicating
    > that the class can not be found.
    >
    > If I copy "Common.vb" and append it to "Page1.aspx.vb"...
    > then no problem, it
    > works just fine.
    >
    > I am trying to find a way to enable these pages to
    > find "Common.vb" without me
    > having to copy the source into each of these pages.
    >
    > I have taken to "Common.vb" and created a seperate
    > project, and compiled it
    > and placed the code in the "bin" folder, but still not
    > luck.
    >
    > Looking at the @Assembly option, it would appear to me
    > that this may allow the
    > assembly to be found, but no matter what I put into this
    > directive, even
    > garbage, it has not effect. It has a "src=" option which
    > indicates that the
    > specified program will be compiled on the fly.
    >
    > So any ideas as to what I need to do to enable the program
    > to be found and
    > compiled on the fly? Or for that matter, found in
    > the "bin" folder? Although
    > I believe it will look in the "Bin" folder for
    > the "folder" which is
    > identified as an "application folder" and unfortuneatly
    > the folder that I am
    > executing from is not an application folder and nor do I
    > have access to the
    > folder which is the application folder to place my
    > compiled program into.
    >
    > Your assistance would be greatly appreciated!!!!!!!!!!!
    >
    >
     
    Stephan Bour, Oct 27, 2003
    #2
    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. William Parker
    Replies:
    1
    Views:
    3,133
    Martin
    Jun 27, 2004
  2. Replies:
    3
    Views:
    587
  3. Trent Mick
    Replies:
    0
    Views:
    497
    Trent Mick
    Apr 3, 2008
  4. Jacob Davis
    Replies:
    0
    Views:
    526
    Jacob Davis
    Apr 15, 2008
  5. Stéphane Klein
    Replies:
    0
    Views:
    302
    Stéphane Klein
    Jul 5, 2011
Loading...

Share This Page