Problem with inheritance of code behind page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Morgan

    Problem with inheritance of code behind page

    I am using Visual Studio with code behind to build files within an
    application. The name of the project is bsecsSql.

    Everything works fine on the local computer when I use 'copy project'
    to copy it to a folder and use an address such as :


    but when I upload it to an internet server and attempt to access a
    page eg


    I get the message
    ""Could not load type 'bsecsSQL.candi dateDetails" with the following
    line outlined in red as an error line

    <%@ Page Language="vb" AutoEventWireup ="false"
    Codebehind="can didateDetails.a spx.vb"
    Inherits="bsecs SQL.candidateDe tails" Trace="true" %>

    This is presumably because the address after 'Inherits' is
    "bsecsSQL.candi dateDetails". However I cannot get the page to work if
    I merely put in
    inherits"candid ateDetails".

    My question is how can ,I within or outside Visual Studio 2003,
    configure the 'inherits' property so that it will work with the URL
    shown above as well as on the local machine?

    Best wishes, John Morgan
  • Natty Gur

    #2
    Re: Problem with inheritance of code behind page

    Hi,

    Inherits set the name of the class that page compilation process use to
    derive the class create from aspx declaration from. So Inherits got
    nothing to do with path.

    ASP.NET looks for this class in the DLL generate for pages code behind
    classes. it looks like you didn't copy that DLL to the Bin directory. or
    that classes use other assemblies that didn't load to the server.

    HTH

    Natty Gur[MVP]

    blog : http://weblogs.asp.net/ngur
    Mobile: +972-(0)52-8888377


    *** Sent via Devdex http://www.devdex.com ***
    Don't just participate in USENET...get rewarded for it!

    Comment

    • John Saunders

      #3
      Re: Problem with inheritance of code behind page

      "John Morgan" <jfm@XXwoodland er.co.uk> wrote in message
      news:ljasc0144l egishiajl5jklal utf2bpim7@4ax.c om...[color=blue]
      > I am using Visual Studio with code behind to build files within an
      > application. The name of the project is bsecsSql.
      >
      > Everything works fine on the local computer when I use 'copy project'
      > to copy it to a folder and use an address such as :
      > http://cms2/bsecsloc/management/elec...teDetails.aspx
      >
      > but when I upload it to an internet server and attempt to access a
      > page eg
      > http://www.bsecs.org.uk//management/...eDetails.aspx:
      >
      > I get the message
      > ""Could not load type 'bsecsSQL.candi dateDetails" with the following
      > line outlined in red as an error line
      >
      > <%@ Page Language="vb" AutoEventWireup ="false"
      > Codebehind="can didateDetails.a spx.vb"
      > Inherits="bsecs SQL.candidateDe tails" Trace="true" %>
      >
      > This is presumably because the address after 'Inherits' is
      > "bsecsSQL.candi dateDetails". However I cannot get the page to work if
      > I merely put in
      > inherits"candid ateDetails".
      >
      > My question is how can ,I within or outside Visual Studio 2003,
      > configure the 'inherits' property so that it will work with the URL
      > shown above as well as on the local machine?[/color]

      John, I bet it wouldn't work even on another machine on your LAN. I don't
      think it's a problem with the URL.

      Where is the assembly containing bsecsSQL.candid ateDetails? Did you put it
      into the bin directory of the target server?

      If you add a reference for that assembly, I think Copy Project will copy it
      to the right place for you.
      --
      John Saunders
      johnwsaundersii i at hotmail


      Comment

      • John Morgan

        #4
        Re: Problem with inheritance of code behind page


        Thank you John and Natty for your help.

        No, the bin directory was not in the bin directory of the target
        server! Going on what you said I changed the location of the bin
        directory from bsecs/management/ to bsecs/ , the target server and
        this got things working together with moving global.asax into the root
        bsecs folder.

        I then decided to delete the'management' folder and copy the files
        and folders of the project directly into the root bsecs folder and
        this works OK.

        However I think what I should have done is to add a reference in the
        project properties as John was suggesting and I could then have used
        my original folder configuration.

        I really do appreciate the help I get from this forum,

        Best wishes, John Morgan


        On Mon, 14 Jun 2004 23:47:46 +0100, John Morgan
        <jfm@XXwoodland er.co.uk> wrote:
        [color=blue]
        >I am using Visual Studio with code behind to build files within an
        >application. The name of the project is bsecsSql.
        >
        >Everything works fine on the local computer when I use 'copy project'
        >to copy it to a folder and use an address such as :
        >http://cms2/bsecsloc/management/elec...teDetails.aspx
        >
        >but when I upload it to an internet server and attempt to access a
        >page eg
        >http://www.bsecs.org.uk//management/...eDetails.aspx:
        >
        > I get the message
        > ""Could not load type 'bsecsSQL.candi dateDetails" with the following
        >line outlined in red as an error line
        >
        > <%@ Page Language="vb" AutoEventWireup ="false"
        >Codebehind="ca ndidateDetails. aspx.vb"
        >Inherits="bsec sSQL.candidateD etails" Trace="true" %>
        >
        > This is presumably because the address after 'Inherits' is
        >"bsecsSQL.cand idateDetails". However I cannot get the page to work if
        >I merely put in
        > inherits"candid ateDetails".
        >
        > My question is how can ,I within or outside Visual Studio 2003,
        >configure the 'inherits' property so that it will work with the URL
        >shown above as well as on the local machine?
        >
        > Best wishes, John Morgan[/color]

        Comment

        Working...