Reading SharePoint User Information in ASP.NET
-
Hi, I have a problem with reading the user information sent by SharePoint Portal link. I have a SharePoint Server where we have designed a home page with links to in house applications. One of these links points to an ASP.NET web site application developed in ASP.NET 2003. I used the Navigation control present on the SharePoint Home Page (I believe this is an inbuilt webpart provided by SharePoint). On clicking of one menu item in this Navigation control, the ASP.NET web application opens in the same page below inside a web page webpart control. I want to display the logged in user;s ID with a message Welcome UserID on ASP.NET application's home page. This thing works for the very first time and shows the correct user name in the message. But when the user loggs into the SharePoint Portal with different UserID (by using "Sign in with different user link), then the changed UserID does not get reflected on the ASP.NET application's home page. It shows the old user id only. I am using folloing code to read the user id on home page. string strUser = this.Context.User.Identity.Name; lblUserName.Text="Welcome " + strUser; I also tried Request server collection variables like "LOGON_USER", "AUTH_USER", etc. but they didn't work. How to get the correct user information on ASP.NET application's home page so that it will reflect the changed user id on sharepoint? Thsnks in advance. Anil
-
Hi, I have a problem with reading the user information sent by SharePoint Portal link. I have a SharePoint Server where we have designed a home page with links to in house applications. One of these links points to an ASP.NET web site application developed in ASP.NET 2003. I used the Navigation control present on the SharePoint Home Page (I believe this is an inbuilt webpart provided by SharePoint). On clicking of one menu item in this Navigation control, the ASP.NET web application opens in the same page below inside a web page webpart control. I want to display the logged in user;s ID with a message Welcome UserID on ASP.NET application's home page. This thing works for the very first time and shows the correct user name in the message. But when the user loggs into the SharePoint Portal with different UserID (by using "Sign in with different user link), then the changed UserID does not get reflected on the ASP.NET application's home page. It shows the old user id only. I am using folloing code to read the user id on home page. string strUser = this.Context.User.Identity.Name; lblUserName.Text="Welcome " + strUser; I also tried Request server collection variables like "LOGON_USER", "AUTH_USER", etc. but they didn't work. How to get the correct user information on ASP.NET application's home page so that it will reflect the changed user id on sharepoint? Thsnks in advance. Anil
Additional information: Web application is installed on different server. SharePoint is on different server. When the user open the SharePoint Portal page first time, an authentication popup comes. Here the user enters usre id and the password to log in into the sharepoint. After that when the user clicks on my application's link, again the authentication popup comes as the application is on different server. But after changing the User from Sharepoint, no authentication popup is displayed for the application and the application shows the old user id only. this may help you to understand the scenario better. anil