471,317 Members | 2,596 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 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 4677
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by David Pretorius | last post: by
2 posts views Thread by Jesper Stocholm | last post: by
3 posts views Thread by Patrick Olurotimi Ige | last post: by
3 posts views Thread by tshad | last post: by
3 posts views Thread by Asaf | last post: by
3 posts views Thread by =?Utf-8?B?Q2hhcmxlc0E=?= | last post: by

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.