我想弄清楚我的程序的哪個部分導致此錯誤。因此,當一個用戶登錄到我的應用程序,所有當前用戶成爲該用戶
我有多個頁面都從PageBase
繼承。他們從PageBase
獲取用戶資料。這是從PageBase
得到他們的用戶名稱的功能:
uiProfile = ProfileManager.FindProfilesByUserName(CompanyHttpApplication.Current.Profile.UserName)
在CompanyHttpApplication
我
public static CompanyHttpApplication Current
{
get { return (CompanyHttpApplication)HttpContext.Current.ApplicationInstance; }
}
和
public CompanyProfileInfo Profile
{
get
{
return profile ??
(profile =
ProfileManager.FindProfilesByUserName(ProfileAuthenticationOption.Authenticated,
User.Identity.Name).Cast
<CompanyProfileInfo>().ToList().First());
}
private set { profile = value; }
}
不幸的是我沒有寫代碼的這一部分,程序員誰做了它不再在項目上。有沒有人可以向我解釋爲什麼當另一個用戶登錄(當我使用應用程序時),我成爲那個用戶?
這是一個WEP應用..?如果是這樣你需要得到Page.UserIdentity.Name.Split(「\」)創建一個字符串[]將其賦值給 – MethodMan
詢問原作者。 – Bernard