Ask a Question related to ASP.NET Security, Design and Development.
-
news.microsoft.com #1
Cast exception w FormsAuthentication
I have a small ASPX app I have created and decided to roll my own Forms
Authentication. Now I take the user name, password and domain and created an
encrypted foms authentication ticket. In the ticket I put some info in the
userdata property. On a different page after authetication I want to accsess
that field. I found a couple of examples, one is like
lblLogin.Text = ((FormsIdentity)User.Identity).Ticket.UserData;
This throws an exception saying cast is not valid. I've looked at this where
the GenericPrincipal is created in the Globalasax file and I can see the
string data in the UserData, does anyone have any idea?
news.microsoft.com Guest
-
#32101 [Com]: Exception in unknown on line 0 when throwing exception inside exception handler
ID: 32101 Comment by: dhopkins at DonHopkins dot com Reported By: ceefour at gauldong dot net Status: No... -
#36840 [Asn->Csd]: Memory leak if cast operator throws an exception that is caught
ID: 36840 Updated by: tony2001@php.net Reported By: andrei@php.net -Status: Assigned +Status: Closed Bug Type: Scripting... -
cast members moved in cast - neet to get htem back!!!
Hello I inadvertedly pasted a cast member into my cast and it bumped the rest of the members one number forward, screwing up my lingo all over the... -
invalid cast exception with XmlSerializer
I have the following web method in which I fill a typed dataset : ))] public XmlDataDocument GetEmployeesTypedXML() {... -
Please help on Specified cast is not valid exception
Hi there! Does anybody know how to override GetWebRequest Method when using WSE on reference.cs. I get a "Specified cast is not valid... -
Chris Jackson #2
Re: Cast exception w FormsAuthentication
Make sure you are casing the proper unary expression:
....((FormsIdentity)(User.Identity)).Ticket.UserDa ta;
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows XP
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--
"news.microsoft.com" <phewwee@yahoo.com> wrote in message
news:%23c0aV$ClDHA.1960@TK2MSFTNGP12.phx.gbl...an> I have a small ASPX app I have created and decided to roll my own Forms
> Authentication. Now I take the user name, password and domain and createdaccsess> encrypted foms authentication ticket. In the ticket I put some info in the
> userdata property. On a different page after authetication I want towhere> that field. I found a couple of examples, one is like
> lblLogin.Text = ((FormsIdentity)User.Identity).Ticket.UserData;
>
> This throws an exception saying cast is not valid. I've looked at this> the GenericPrincipal is created in the Globalasax file and I can see the
> string data in the UserData, does anyone have any idea?
>
>
Chris Jackson Guest



Reply With Quote

