Interface IPrincipal Problem
Iam not good at English ,sorry ,but I need help urgently!Thank you!
In Book < ASP.NET Website Programming: Problem - Design - Solution, C# Edition >
The author give a method to implement the Interface IPrincipal.
Then I try to create a class named 'NetPrincipal' implementing this Interface(IPrincipal).In my program,there are some codes like following: context.User=netPrincipal1 //this can run
//netPrincipal1 is a instance of NetPrincipal
//but when change to another page
NetPrincipal n=(NetPrincipal)Contex.User// this can not run
// error: invalidcasting!
How to solve this problem.
nightsun
|