Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution 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 March 2nd, 2004, 01:48 PM
Authorized User
 
Join Date: Mar 2004
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default SiteIdentity TypeCasting Problem

I have a problem, this piece of code gives me a type Casting error and i dont know why!??

Dim ID As SiteIdentity = CType(Context.User.Identity, SiteIdentity)

Please Help!

Rob

 
Old March 5th, 2004, 03:10 PM
Registered User
 
Join Date: Mar 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That's because the User.Identity cannot be casted to SiteIdentity. Try to set a pointer and you will see that the type of User.Identity is FormsIdentity and not SiteIdentity. This is something that many people experince, the principal gets lost somehow...

 
Old September 15th, 2005, 10:42 AM
Registered User
 
Join Date: Aug 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to prune_3_16 Send a message via Yahoo to prune_3_16
Default

I'm one of those who has the same problem as RM28. Is there a solution to this problem?

Thanks.

 
Old September 17th, 2005, 10:38 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Casting errors of the identity or principal objects are almost always caused by a problem in your base page, or your failure the ensure the base init event gets called at the right time in your .aspx pages.

It's hard to determine the exact situation for each person without going through your code in Visual Studio. You should take your time and makes sure your code is right and your projects are set up right.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Typecasting for arrayList SKhna ASP.NET 2.0 Basics 6 February 13th, 2008 03:48 PM
SitePrinciple and SiteIdentity casting problems BenCh BOOK: ASP.NET Website Programming Problem-Design-Solution 3 August 21st, 2006 10:47 AM
typecasting int to java.lang.Integer ruchilalla J2EE 1 May 23rd, 2005 06:11 AM





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