Sunday, March 6, 2011

IIS 7.0 configuration issue: This configuration section cannot be used at this path. This happens when the section is locked a

HTTP Error 500.19 - Internal Server Error

Description: The requested page cannot be accessed because the related configuration data for the page is invalid.

Error Code: 0x80070021

Notification: BeginRequest

Module: IIS Web Core

Requested URL: http://localhost:80/

Physical Path: C:\www\Projects\3.5 VS 2008 Beta\Elbalazo\Web

Logon User: Not yet determined

Logon Method: Not yet determined

Handler: Not yet determined

Config Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

Config File: \\?\C:\www\Projects\3.5 VS 2008 Beta\Elbalazo\Web\web.config
Config Source:

170:
171:
172:

More Information... This error occurs when there is a problem reading the configuration file for the Web server or Web application. In some cases, the event logs may contain more information about what caused this error.

Server Version Information: Internet Information Services 7.0.

The handlers section is talking about this in my web.config which I believe is there by default when you create a new web application in the .NET 3.5 framework:
























Initially I thought this problem was because I needed to change overrideModeDefault="Deny" to overrideModeDefault="Allow" so I changed all instances of this to Allow in my C:\Windows\System32\inetsrv\config\applicationHost.xml file on my Vista Ultimate machine. That made this error go away but then the second error stated that a handler that is mapped in my web.config has a problem.


Working Solution

Received this same issue after installing IIS 7 on Vista Home Premium. To correct error I changed the following values located in the applicationHost.config file located in Windows\system32\inetsrv.

Change all of the following values located in section -->

*
change this value from "Deny" to "Allow"
*
change this value from "Deny" to "Allow"

Jquery Regular Expression validation

function isValidDate(dateString)
{
var regEx = /^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/; //regular expression
if (regEx.test(dateString))
{
return true;
}
else
{
return false;
}
}

Jquery Fix for Calendar to work on postback inside update panel

/*Handling jquery datepicker to work on update panel after post back.Added on */
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

function EndRequestHandler(sender, args)
{
$("#<%= txtCalendar.ClientID %>").datepicker({
numberOfMonths: 1,
dateFormat: 'dd/mm/yy',
changeMonth: true,
changeYear: true,
beforeShow: customRange

});
}