I am new to sharepoint(2010). I have created a application page.Now when I run it on other machines it prompts me with the username and password credentials which is annoying for end user.
How can I resolve this problem?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityTo set up you SharePoint application page to allow anonymous access, the key here is that you cannot use the default LayoutsPageBase base class for your page because it would trigger SharePoint to prompt anonymous users to log on.
Instead, you need to use another base class for your anonymous application page called UnsecuredLayoutsPageBase. You can find its MSDN reference at: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.unsecuredlayoutspagebase.aspx
Your page class would look like this:
public partial class ApplicationPage1 : UnsecuredLayoutsPageBase
{
protected void Page_Load(object sender, EventArgs e)
{
}
If the SharePoint server and the client PC are not in the same Active Directory forest, then you will always get this if you are using Windows authentication.
If you are using Internet Explorer you should ensure that the server is listed in the Trusted Sites on the Security tab of Internet Options.