BC30451: Name 'Mystyle' is not declared

Last post 07-31-2009 8:26 PM by rpayne7264. 6 replies.

Sort Posts:

  • BC30451: Name 'Mystyle' is not declared

    06-29-2009, 6:22 AM
    • Contributor
      2,320 point Contributor
    • susain
    • Member since 10-29-2007, 11:51 AM
    • Hyderabad, Andhra Pradesh, India
    • Posts 641

    Hi Friends,

    I have created class file with name Mystyle and the code is as follows

    Imports Microsoft.VisualBasic
    Public Class Mystyle
        Public Shared Function Msg() As String
            Dim st As String
            st = "Hi boss How r u"
            Return st
        End Function
    End Class

    I am calling this as Response.Write(mystyle.Msg())

    This is working fine in my local system fine but I am getting the below error in the development server.

    Compiler Error Message: BC30451: Name 'Mystyle' is not declared.

    Source Error:

    Line 7:              Response.Write(Mystyle.Msg())

    Can any one help me?

     

    Thanks,

    Farooq

    Linked In: http://www.linkedin.com/in/mohammedfarooq123

    Mark as answer if this post help full to you.
  • Re: BC30451: Name 'Mystyle' is not declared

    06-29-2009, 9:24 AM
    • Contributor
      2,748 point Contributor
    • shabirhakim1
    • Member since 03-31-2009, 11:33 AM
    • Bangalore
    • Posts 443

    Hey,

     

    Just check where you have kept your class file,better put this class in App_Code Folder.

    if still it would't work just recompile it

     

    Regards

    hakim,

     

     

    Good is Never Good .if better is accepted
  • Re: BC30451: Name 'Mystyle' is not declared

    06-29-2009, 11:54 PM
    • Contributor
      2,320 point Contributor
    • susain
    • Member since 10-29-2007, 11:51 AM
    • Hyderabad, Andhra Pradesh, India
    • Posts 641

    Thanks for the reply hakim!

    Yes the class file is in App_code folder.

    I created a new page and built the solution and got the output in my local system as Hi boss How r u

    I uploaded the bin file, class file and newly created page.

    Again I am getting the above specified error in the development server.

    Need help and suggestions

    Thanks,

    Farooq

    Linked In: http://www.linkedin.com/in/mohammedfarooq123

    Mark as answer if this post help full to you.
  • Re: BC30451: Name 'Mystyle' is not declared

    06-30-2009, 11:05 PM
    • Contributor
      2,320 point Contributor
    • susain
    • Member since 10-29-2007, 11:51 AM
    • Hyderabad, Andhra Pradesh, India
    • Posts 641

    Need help,

     

    Thanks,

    Farooq

    Linked In: http://www.linkedin.com/in/mohammedfarooq123

    Mark as answer if this post help full to you.
  • Re: BC30451: Name 'Mystyle' is not declared

    07-01-2009, 1:44 AM
    • Contributor
      2,748 point Contributor
    • shabirhakim1
    • Member since 03-31-2009, 11:33 AM
    • Bangalore
    • Posts 443

     

    hey ,

    • A common cause is a simple misspelling where the class name is used. For example:
    dim connection as OdbcConection;

    Here the class name should have been 'OdbcConnection'. The solution is to correct the spelling.

    • If the name is correct then the next most likely cause is that the required namespace has not been imported. For example:
    dim connection as OdbcConnection;
    .
    .
    [Error] Type 'OdbcConnection' is not defined.

    In this example 'OdbcConnection' is defined in the namespace 'System.Data.Odbc' (although this differs been the .Net framework 1.0 and later versions). Try importing the necessary namespace, so in this case:

    VB.NET: Imports System.Data.Odbc
    C#: using System.Data.Odbc;

    "imports" (or "using") statement must be included at the very top of the file.

    Just Observe properly whether things are going

    Good is Never Good .if better is accepted
  • Re: BC30451: Name 'Mystyle' is not declared

    07-01-2009, 2:08 AM
    • Contributor
      2,320 point Contributor
    • susain
    • Member since 10-29-2007, 11:51 AM
    • Hyderabad, Andhra Pradesh, India
    • Posts 641

    Thanks for the reply Hakim!

    Let me tell you that Mystyle class doesn’t have any namespace and it contains only the simple logic, you can refer above code.

    I am calling the class fuction like this lblMessage.Text = Mystyle.Msg

    Mystyle is the class file name and Msg is the function, I checked and the names are same.

    I don’t understand why the problem is in development server only.

     

    Thanks,

    Farooq

    Linked In: http://www.linkedin.com/in/mohammedfarooq123

    Mark as answer if this post help full to you.
  • Re: BC30451: Name 'Mystyle' is not declared

    07-31-2009, 8:26 PM
    • Member
      2 point Member
    • rpayne7264
    • Member since 07-31-2009, 8:24 PM
    • Posts 1

    I just ran into the same problem.

    I solved it by going into IIS on my dev machine and converting my virtual directory to an application.

     

Page 1 of 1 (7 items)