asp.net 2005 question re: "reference to a non-shared member requires an object reference"

Discussion in 'ASP .Net' started by ce, Jun 23, 2005.

  1. ce

    ce Guest

    I've got a class "A" which has a shared (static) method "Test". In an
    asp.net page i can use it like so:

    <td><%=A.Test()%></td>

    and all is fine, but if instead of a page it's an ascx (control) then i get
    the following error in the same scenario:

    "reference to a non-shared member requires an object reference".

    Any ideas why?

    I'm using vb.net 2005 if that's any significance.

    Thanks,

    Chris
     
    ce, Jun 23, 2005
    #1
    1. Advertising

  2. ce

    ce Guest

    Also, I'm using IIS 5.1 with ASP.NET 2.0 Beta 2.


    Brent Minder BugMonitor.com, Inc. PO Box 1168 Duluth, GA 30096 Phone
    404.234.0540 We make your software better.
    "ce" <> wrote in message
    news:LAnue.1358$...
    > I've got a class "A" which has a shared (static) method "Test". In an
    > asp.net page i can use it like so:
    >
    > <td><%=A.Test()%></td>
    >
    > and all is fine, but if instead of a page it's an ascx (control) then i
    > get the following error in the same scenario:
    >
    > "reference to a non-shared member requires an object reference".
    >
    > Any ideas why?
    >
    > I'm using vb.net 2005 if that's any significance.
    >
    > Thanks,
    >
    > Chris
    >
    >
    >
    >
     
    ce, Jun 23, 2005
    #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. ad
    Replies:
    5
    Views:
    1,594
  2. Juan T. Llibre
    Replies:
    0
    Views:
    470
    Juan T. Llibre
    Jun 7, 2005
  3. Sql Agentman
    Replies:
    0
    Views:
    658
    Sql Agentman
    Jan 19, 2006
  4. Replies:
    5
    Views:
    348
    Juan T. Llibre
    May 17, 2007
  5. XJ
    Replies:
    8
    Views:
    1,760
Loading...

Share This Page