Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > asp.net 2005 question re: "reference to a non-shared member requires an object reference"

Reply
Thread Tools

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

 
 
ce
Guest
Posts: n/a
 
      06-23-2005
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




 
Reply With Quote
 
 
 
 
ce
Guest
Posts: n/a
 
      06-23-2005
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
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why can derived member function not access protected member of a baseclass object? blangela C++ 8 09-26-2008 03:24 PM
A reference to a hash member? (to an object's member variable) A. Farber Perl Misc 5 08-23-2008 07:00 AM
ASP.NET 2.0: master pages and web user controls: reference to a non-shared member requires an object reference bminder ASP .Net 0 06-24-2005 12:22 AM
Differences between "class::member" & "object.member" Jian H. Li C++ 4 02-13-2004 10:54 AM
How would I use qsort to sort a struct with a char* member and a long member - I want to sort in order of the long member Angus Comber C Programming 7 02-05-2004 06:41 PM



Advertisments