473,231 Members | 1,796 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,231 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 4725
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> glsD:%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: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...

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.