469,579 Members | 1,157 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,579 developers. It's quick & easy.

Forms Authentication User Name

I have written a simple forms authentication login page, where a user is
redirected to default page after he is logged in ...

the login page submit button looks like

FormsAuthentication.RedirectFromLoginPage(user.Ema il, false);
Is it possible to get user email on other pages ....

I tried

Response.Output.WriteLine("Page UserName " + Page.User.Identity.Name);
but it doesnt works...

thanks
Aug 15 '06 #1
2 1084
You should be able to get it.. if they are web forms..

Anyway , try with the following code

System.Web.Security.FormsIdentity id =
(System.Web.Security.FormsIdentity) HttpContext.Current.User.Identity;
Response.Output.WriteLine("Page UserName " + id.Name.ToString());

ashish wrote:
I have written a simple forms authentication login page, where a user is
redirected to default page after he is logged in ...

the login page submit button looks like

FormsAuthentication.RedirectFromLoginPage(user.Ema il, false);
Is it possible to get user email on other pages ....

I tried

Response.Output.WriteLine("Page UserName " + Page.User.Identity.Name);
but it doesnt works...

thanks
Aug 15 '06 #2
Kumar,
thanks for the answer but it still doesnt works :(
Other thing i might want to add is that anonymous user setting is on,
and I have custom membership and profile providers...
I can send you the complete code if you want...

regards

Kumar Reddi wrote:
You should be able to get it.. if they are web forms..

Anyway , try with the following code

System.Web.Security.FormsIdentity id =
(System.Web.Security.FormsIdentity) HttpContext.Current.User.Identity;
Response.Output.WriteLine("Page UserName " + id.Name.ToString());

ashish wrote:
>I have written a simple forms authentication login page, where a user is
redirected to default page after he is logged in ...

the login page submit button looks like

FormsAuthentication.RedirectFromLoginPage(user.Ema il, false);
Is it possible to get user email on other pages ....

I tried

Response.Output.WriteLine("Page UserName " + Page.User.Identity.Name);
but it doesnt works...

thanks
Aug 15 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by ElmoWatson | last post: by
3 posts views Thread by Kris van der Mast | last post: by
3 posts views Thread by Martin | last post: by
reply views Thread by Anonieko Ramos | last post: by
6 posts views Thread by Manny Chohan | last post: by
7 posts views Thread by Justin | last post: by
8 posts views Thread by =?Utf-8?B?TFc=?= | last post: by
1 post views Thread by Sean | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.