Wrox Programmer Forums
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 18th, 2003, 07:39 AM
Registered User
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Interface IPrincipal

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.


Similar Threads
Thread Thread Starter Forum Replies Last Post
IDbCommand Interface goser C# 2005 1 October 24th, 2007 03:14 AM
interface with these networks saish Other Programming Languages 0 May 22nd, 2006 01:13 AM
Interface IPrincipal Problem nightsun BOOK: ASP.NET Website Programming Problem-Design-Solution 1 December 1st, 2003 06:44 PM
Regarding Interface ndr1977 BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 July 30th, 2003 09:56 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.