Type "ProfileCommon" is not defined

Last post 11-10-2009 11:05 AM by bexasp. 2 replies.

Sort Posts:

  • Type "ProfileCommon" is not defined

    04-26-2006, 6:33 PM
    • Member
      175 point Member
    • y71chen
    • Member since 03-28-2006, 4:21 PM
    • Posts 35
    Hi

    I opened the default.aspx in the vs2005 but i got two errors saying:
    Type "ProfileCommon" is not defined.
    on line:
    <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" CodeFile="Default.aspx.vb"
        Inherits="Default_aspx" Title="Welcome" %>

    and also i got errors:
    Error    3    Element 'FeaturedAd' is not a known element. This can occur if there is a compilation error in the Web site.    C:\Inetpub\newwwwroot\ad\Default.aspx    36    18    http://ad/
    Error    4    Element 'CategoryBrowse' is not a known element. This can occur if there is a compilation error in the Web site.    C:\Inetpub\newwwwroot\ad\Default.aspx    48    22    http://ad/
    on lines:
    <%@ Register TagPrefix="uc1" TagName="FeaturedAd" Src="Controls/FeaturedAd.ascx" %>
    <%@ Register TagPrefix="uc1" TagName="CategoryBrowse" Src="Controls/CategoryBrowse.ascx" %>
    What can i do to correct these? i found a post talking about this ProfileCommon problem:
    http://forums.asp.net/1141608/ShowPost.aspx
    but i dont really know what they are talking about, because i am not trying to do any of those things, so can anyone please tell me how i can fix this problem?

    Thanks in advance!
    -yue

  • Re: Type "ProfileCommon" is not defined

    04-18-2009, 1:51 AM
    • Member
      9 point Member
    • YdoIbother
    • Member since 05-18-2006, 12:36 PM
    • Posts 5

    I got this error when I put a .js file in my App_Code directory.  Moving it elsewhere solved the problem.  Make sure you haven't accidently dropped something in App_Code.

  • Re: Type "ProfileCommon" is not defined

    11-10-2009, 11:05 AM
    • Member
      6 point Member
    • bexasp
    • Member since 10-24-2009, 11:32 AM
    • Posts 27

    Hi there i got the same error today,

    I added a new class in app_code , The class is working in C#  but i need it on VB so i used the online C# to VB trans tool,  than it gave me the error.

    this is the vb

    Imports System
    Imports System.Web
    Imports System.Web.Security
    Imports SecurityLib
    
    
    Public Class ProfileWrapper
        
        
        Public Sub New()
                
            Dim profile As ProfileCommon = TryCast(HttpContext.Current.Profile, ProfileCommon)
        End Sub
        
        Public Sub UpdateProfile()
                
            Dim profile As ProfileCommon = TryCast(HttpContext.Current.Profile, ProfileCommon)
        End Sub
    End Class


    and this c#

    using System;
    using System.Web;
    using System.Web.Security;
    using SecurityLib;
    
    
    public class ProfileWrapper
    {
    
    
      public ProfileWrapper()
      {
        ProfileCommon profile =
          HttpContext.Current.Profile as ProfileCommon;
       
      }
    
      public void UpdateProfile()
      {
        ProfileCommon profile =
           HttpContext.Current.Profile as ProfileCommon;
        
    }


    Do i need to imports sometning?

     

    thanks

     

     

Page 1 of 1 (3 items)