INHERITS and NAMESPACES - VB, ASP.NET


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: INHERITS and NAMESPACES - VB, ASP.NET

  1. #1
    Paul Murphy Guest

    INHERITS and NAMESPACES - VB, ASP.NET

    I really am at a total loss. I have a project where I have determined that
    the proper namespaces will be as follows


    VB Components (.DLL)

    HappyME.Data.Common
    HappyME.Data.DATACOMPONENTNAME ( about 10 of these )
    HappyME.Common.Images
    HappyME.Common.Image
    HappyME.Common.Members
    HappyME.Common.Member
    HappyME.Common.Sites
    HappyME.Common.Site
    HappyME.Common.Boards
    HappyME.Common.Message

    ASP.NET (VB) Components

    HappyME.Web.Common.LiveShows
    HappyME.Web.Common.Contact
    HappyME.Web.Common.Videos
    HappyME.Web.Common.XXXPhotos
    HappyME.Web.Common.DailyGirls
    HappyME.Web.Common.Webmaster
    HappyME.Web.SexParadies.

    My bottom two tiers are in great shape. All my namespace, inherits,
    implement, overloads, etc... work just fine here. When i get into the realm
    of the web application nothing seems to work. Every page ( I've tired with 3
    or 4 different configurations ) dies with the same error:

    Parser Error Message: 'HappyME.Web.Common.LiveShows.main' is not a
    valid base class to inherit from
    Line 1: <%@ Page Language="vb" AutoEventWireup="false"
    Codebehind="main.vb" Inherits="HappyME.Web.Common.LiveShows.main"%>


    The code behind is as follows :

    <SIC> all the standard imports </SIC>
    Namespace HappyME.Web.Common.LiveShows

    Public Class main

    Inherits System.Web.UI.Page


    #Region " Web Forms Designer Generated Code "


    Dim WithEvents main As System.Web.UI.Page


    Sub New()

    main = Me

    End Sub


    'CODEGEN: This procedure is required by the Web Form Designer

    'Do not modify it using the code editor.

    Private Sub InitializeComponent()


    End Sub


    #End Region


    Protected Sub main_Load(ByVal Sender As System.Object, ByVal e As
    System.EventArgs)

    If Not IsPostback Then ' Evals true first time browser hits the page


    End If

    End Sub


    Protected Sub main_Init(ByVal Sender As System.Object, ByVal e As
    System.EventArgs)

    'CODEGEN: This method call is required by the Web Form Designer

    'Do not modify it using the code editor.

    InitializeComponent()

    End Sub


    End Class


    End Namespace



    When I go out to another project and point a reference back in all the the
    namespace.space.space.classnames show up as the should. But the ASP.NET
    engine won't accept this. What am I missing here. I've spent a good amount
    of time digging through all the .NET web sites. the MSDN is useless as it
    never even addresses changing the default projectname.classname namespace
    structures to a chosen structure for a ASP.NET application. When i use the
    standard projectname.classname structure the pages work, but this doesn't
    work with the rest of my design schema. Once again any help would be greatly
    appreciated.





    Paul Murphy

    CD:X Service




  2. #2
    Dana Fillhart Guest

    Re: INHERITS and NAMESPACES - VB, ASP.NET

    I posted this reply on aspngreuse, but I'll do it here for others' benefit:
    ------

    Is "HappyME" the name of your web project?

    I had a similar problem, and solved it by prefixing my Inherits namespaces
    in the @Page directive with the web project name as follows:

    <%@ Page Language="vb" AutoEventWireup="false" Codebehind="main.vb"
    Inherits="WEBPROJECTNAME.HappyME.Web.Common.LiveShows.main"%>

    My situation was slightly different, in that I was using @Control directive
    in an .ascx file, but the principle should be the same. (And yes, that's
    not documented anywhere that I've seen.)

    --Dana Fillhart



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center