Dec 03, 2010, 7:57 PM
1.0 - cleanResourceUrl won't work in IIS 7.0 unless handler/module entries exist under system.web
If you're running IIS 7.0 and only put the handler/module entries for the ext.axd resource handler under the system.webServer section (which is standard practice), the resource URLs that are emitted by Ext.NET will always default to using WebResource.axd instead of the cleaner version referencing ext.axd. This is because the HasHandler method under Ext.Net.ResourceHandler looks explicitly for the httpHandlers node (specific to IIS 6.0 and earlier) instead of that OR the handlers node (specific to IIS 7.0):
bool result = false;
string path = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, "web.config");
XmlTextReader reader = new XmlTextReader(new StreamReader(path));
try
{
if (reader.ReadToFollowing("httpHandlers"))
{
if (reader.ReadInnerXml().Contains("type=\"Ext.Net.ResourceHandler\""))
{
result = true;
}
}
}
This necessitates adding both handler/module declarations to the web.config in order to use cleanResourceUrl when running IIS 7.0.