473,320 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Can we set User.Identity by program

ad
The User.Identity of WebPages is set with login controls in asp.net 2.0.
Can we set the User.Identity with program not by Login Controls?

I have tried the code:
this.User.Identity="Jhon", but it fail when compile.
Jan 25 '06 #1
2 4726
ad,

Yes, you can set the user identity yourself. However, you can't just
set the identity like you want.

What you need to do is create a custom membership and possibly a role
provider for ASP.NET.

Take a look at the document on MSDN titled "Membership Providers",
located at (watch for line wrap):

http://msdn.microsoft.com/library/de...vMod_Intro.asp

It should help you out.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"ad" <fl****@wfes.tcc.edu.tw> wrote in message
news:O9**************@TK2MSFTNGP12.phx.gbl...
The User.Identity of WebPages is set with login controls in asp.net 2.0.
Can we set the User.Identity with program not by Login Controls?

I have tried the code:
this.User.Identity="Jhon", but it fail when compile.

Jan 25 '06 #2
ad
Thanks,
But it is so tedious. Have there any simple ways?

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> ¼¶¼g©ó¶l¥ó·s»D:%2****************@TK2MSFTNGP15.phx .gbl...
ad,

Yes, you can set the user identity yourself. However, you can't just
set the identity like you want.

What you need to do is create a custom membership and possibly a role
provider for ASP.NET.

Take a look at the document on MSDN titled "Membership Providers",
located at (watch for line wrap):

http://msdn.microsoft.com/library/de...vMod_Intro.asp

It should help you out.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"ad" <fl****@wfes.tcc.edu.tw> wrote in message
news:O9**************@TK2MSFTNGP12.phx.gbl...
The User.Identity of WebPages is set with login controls in asp.net 2.0.
Can we set the User.Identity with program not by Login Controls?

I have tried the code:
this.User.Identity="Jhon", but it fail when compile.


Jan 25 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bucky Pollard | last post by:
I have a web service that needs to create a batch file and call it (since there are no APIs for the functionality I am looking for). I am using the Process and ProcessStartInfo objects. When I try...
0
by: David Pretorius | last post by:
Hi, trying to run an outlook and winfax pro applications from vb .net web application program. I have tried many setups from the impersonation and changing authentication. I am running xp...
2
by: Jesper Stocholm | last post by:
I have implemented role-based security within my ASP.Net application. However, it seems the role is not passed to the authentication ticket I create. I want to use it to display/hide some...
4
by: Dan Bart | last post by:
I am using an application which is a modification of IBuySpy Portal. It is using Forms authentication. Users login and their name is added to Context Then I use: ...
8
by: Razak | last post by:
Hi, I have a class which basically do Impersonation in my web application. From MS KB sample:- ++++++++++++++++++++code starts Dim impersonationContext As...
3
by: Patrick Olurotimi Ige | last post by:
How can i send LOGON_USER or User.Identity.Name to the Database? I'm working on a survey which is intranet based with Windows Authentication. I can get the current user by calling LOGON_USER or...
3
by: tshad | last post by:
I am playing with GenericPrincipal classes and am using a sample program to test it. The problem is that even though I set the roles (which shows the roles in the Context.User as being there),...
3
by: Asaf | last post by:
Hello, I have created a web service name "TestWS" and published it to my SBS2003 server that uses IIS6 as a web server. I have set NO anonymous access to TestWS virtual directory and I have...
3
by: =?Utf-8?B?Q2hhcmxlc0E=?= | last post by:
hi folks, I've got XP pro service pack 2 VS 2005 TSE with ASP.net 2.0 and C# I'm doing an example from Stephen Walther's so far excellent book and he has a whole load of stuff to add the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.