how to fix "Server Error in '/' Application" on webserver

Posted on 2011-10-11
Last Modified: 2012-05-12
I have developed my web application using c# version 4.0 and hosted it on webserver as a shared hosting. All the pages are loading fine from the server (including pages which access database)except the pages which need Forms Authentication.  I have a directory of pages (called Quiz) which are only accessible by the authorised users. But when the user's after login try to access it they get runtime .net error page. The application runs perfectly on my local IIS 7.0. I have customerrors mode="off" but cant view the detailed error. My web.config is attached and appreciate any comments
<?xml version="1.0"?>


		<!--<add name="DatatClassesConnectionString" connectionString="Data Source=CHLP0120\MSSQL;Initial Catalog=LifeInTheUK;Integrated Security=True" providerName="System.Data.SqlClient" />-->
		<add name="DatatClassesConnectionString" connectionString="Data;Initial Catalog=lifeintheuk;User ID=lifeintheuk;Password=xxxxxxxxxxxxx"  providerName="System.Data.SqlClient" />


	<location path="PL/Quiz">

			<customErrors mode="Off"/>



				<allow users="user"/>
				<deny users="*"/>





				<clear />
				<add value="Home.aspx" />

		<authentication mode="Forms">
			<forms path="/" loginUrl="~/Login.aspx" protection="All" timeout="5"/>

		<sessionState mode="InProc" cookieless="false" timeout="30"/>

		<compilation debug="true" targetFramework="4.0">
				<add assembly="System.Data.Linq, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
				<add assembly="System.Design, Version=, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
				<add assembly="System.Windows.Forms, Version=, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
				<add assembly="System.Speech, Version=, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
		<pages maintainScrollPositionOnPostBack="True" enableEventValidation="true" />
			<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />


		<validation validateIntegratedModeConfiguration="false" />
			<add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />

Open in new window

Question by:mmalik15
    LVL 15

    Expert Comment

    does the show friendly errors in the advanced options of the browser is selected?
    LVL 2

    Expert Comment

    Should the path be a relative rather than an absolute address?
    LVL 17

    Expert Comment

    You may need to register framework with IIS i.e. aspnet_regiis

    Author Comment

    yeah browser.xul.error_pages.enabled;true
    and the paths are relative. When i get the error I can see the correct path in the browser.
    Try to access this, this page is for only logged in users and when you click on above it should re direct you to login.aspx but its not and rather giving that error
    LVL 2

    Accepted Solution

    Just a question from me I am afraid.

    Is "PL/Quiz" a real directory or you are using URL routing?

    Author Closing Comment

    Thank you. your comment gave me a tip to solve the issue
    LVL 2

    Expert Comment

    Thanks M8 but please share the solution for the benefit of others who have the same problem.

    Author Comment

    Actually I had the directory Quiz inside a parent directory PL but at some point moved it to root directory whereas in my web.config i forgot to change the path.

    Author Comment

    changed <location path="PL/Quiz"> to <location path="Quiz"> and it worked fine :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Suggested Solutions

    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now