H
Hans De Schrijver
First off, I'm pretty new to web development with C# and ASP.NET.
With that said, I've been scratching my head for the past 2 hours, trying to
figure out the following problem:
I created a first project (CLSLibrary) with one class (user.cs), defined as
"public class User". This class contains some public methods and properties
as well as some public static methods. This class lives in CLSLibrary
namespace and builds correctly into CLSLibrary.dll.
Subsequently, I created a second project (Tester) within the same solution.
This project contains one Web Form (CLSTester.aspx) and the corresponding
CLSTester.aspx.cs file.
In the second project I added a reference to CLSLibrary.
Now here's the problem: When I try to run CLSTester.aspx I receive the
following error:
*** System.Web.UI.Page.User' denotes a 'property' where a 'class' was
expected. ***
The line that causes the error reads:
User u = User.GetUser(1);
The GetUser() function is a static function of the User class and returns a
User object. I did notice that the IntelliSense on the User object u doesn't
reveal any properties or methods of the User class but rather just the
default object properties and methods.
Note: The User class was initially developed and tested as part of a Web
Form where both the test Class and the User class lived in the same aspx
file. The user class worked perfect that way. Only now by trying to separate
UI from CLS library am I not getting the aspx file to recognize the User
class.
Could anyone shed some light on this? I suppose it's a trivial matter, but
being a newby I'm just not seeing it...
-- Hans De Schrijver
With that said, I've been scratching my head for the past 2 hours, trying to
figure out the following problem:
I created a first project (CLSLibrary) with one class (user.cs), defined as
"public class User". This class contains some public methods and properties
as well as some public static methods. This class lives in CLSLibrary
namespace and builds correctly into CLSLibrary.dll.
Subsequently, I created a second project (Tester) within the same solution.
This project contains one Web Form (CLSTester.aspx) and the corresponding
CLSTester.aspx.cs file.
In the second project I added a reference to CLSLibrary.
Now here's the problem: When I try to run CLSTester.aspx I receive the
following error:
*** System.Web.UI.Page.User' denotes a 'property' where a 'class' was
expected. ***
The line that causes the error reads:
User u = User.GetUser(1);
The GetUser() function is a static function of the User class and returns a
User object. I did notice that the IntelliSense on the User object u doesn't
reveal any properties or methods of the User class but rather just the
default object properties and methods.
Note: The User class was initially developed and tested as part of a Web
Form where both the test Class and the User class lived in the same aspx
file. The user class worked perfect that way. Only now by trying to separate
UI from CLS library am I not getting the aspx file to recognize the User
class.
Could anyone shed some light on this? I suppose it's a trivial matter, but
being a newby I'm just not seeing it...
-- Hans De Schrijver