Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
|
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 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 June 19th, 2010, 05:15 AM
Authorized User
 
Join Date: Mar 2010
Posts: 27
Thanks: 2
Thanked 1 Time in 1 Post
Default User.Identity.Name

I used
Code:
User.Identity.Name
and I want in another page in page load to remove this Identity
I did like this:
Code:
protected void Page_Load(object sender, EventArgs e)
    {
     User.Identity.Name.remove();
    {
but the above code give me an error :
Compiler Error Message: CS1501: No overload for method 'Remove' takes '0' arguments

Last edited by msomar; June 19th, 2010 at 05:44 AM..
 
Old June 20th, 2010, 02:31 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

What are you trying to achieve? Your Remove call tries to remove characters from the user name string, which doesn't seem to make sense to me: http://www.google.com/url?sa=t&sourc...mI79ZsNOaQJctw

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old July 15th, 2010, 02:55 AM
Authorized User
 
Join Date: Apr 2008
Posts: 35
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Surely, the identity is the person (authenticated user) who started the process and therefore could not be removed? Wouldn't that give the impression that your application/process was being run anonymously?

If you're using the value from User.Identity.Name for something in another process and need to pass on a blank value, why not simlpe assign the vale to a variable and when needed, set it to an empty string?

MSOMAR was right in the comment that it would help to know what you are aiming for.
__________________
Regards,

Sean





Similar Threads
Thread Thread Starter Forum Replies Last Post
User Identity stonesbg ASP.NET 2.0 Basics 1 February 9th, 2007 11:14 AM
User.Identity.Name and accessing it from code CodeBugger C# 3 May 24th, 2006 04:41 PM
Context.User.Identity.Name jimbeam36 BOOK: ASP.NET Website Programming Problem-Design-Solution 4 November 6th, 2004 06:33 AM
ascx issue with User.Identity.Name ian.macey Classic ASP Basics 2 June 11th, 2003 02:50 AM





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