CENTRAL ADMIN
I have created a web application using claims based authentication. I have allowed anonymous access on the default zone. Anonymous policy is set to none in central admin for the default zone. I have added no additional users in 'User Policy'.
SITE COLLECTION LEVEL
Site settings -> Site Permissions -> Anonymous Access -> Entire Web Site.
Now... can anyone tell my why I always get a login prompt when using my custom masterpage? In other words, what in my code-behind could be triggering the login prompt?
private void addControl(){if (Session[sessionName] == null)
{
if (!SPContext.Current.Item.DoesUserHavePermissions(SPBasePermissions.AddAndCustomizePages))
{
UserControl journeyUserControl = (UserControl)Page.LoadControl(String.Format("~/_controltemplates/BB/{0}Journey.ascx", sessionName) );
phJourney.Controls.Add(journeyUserControl);
}
Session[sessionName] = true;
}
}
private void Localise()
{
SPVariationHelper vHelper = new SPVariationHelper(Page);
uint language;
uint.TryParse(vHelper.GetDefaultVariationID(), out language);
if (HttpContext.Current.User.Identity.IsAuthenticated)
{
(loginView.FindControl("loginStatus") as LoginStatus).LogoutText = SPUtility.GetLocalizedString("$Resources:BWCore,Logout", "BWCore", language);
}
else
{
(loginView.FindControl("login") as Label).Text = SPUtility.GetLocalizedString("$Resources:BWCore,Login", "BWCore", language);
(loginView.FindControl("register") as Label).Text = SPUtility.GetLocalizedString("$Resources:BWCore,Register", "BWCore", language);
}
}