Hi All

Am getting a headache trying to implement webforms (as opposed to MVC)
routing. I want to send all requests for http://mysite/articles/<articlename>
to a particular route handler. And it works, provided that I append .aspx
onto the URL (so
http://mysite/articles/<articlename>.aspx<http://mysite/articles/%3Carticlename%3E.aspx>instead
of
http://mysite/articles/<articlename>). If I lose the .aspx extension I get a
404.

It strikes me that this is an IIS level thing rather than an application
thing, but I cannot figure out what it is. I'm running IIS 7 on Vista on my
test box.

The relevant bits of my web.config as follows :

<system.webServer>
     <validation validateIntegratedModeConfiguration="false"/>
     <modules>
        <remove name="ScriptModule"/>
        <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule,
System.Web.Routing, Version=3.5.0.0, Culture=neutral,
PublicKeyToken=31BF3856AD364E35" />
    </modules>
    <handlers>
        <add name="UrlRoutingHandler" preCondition="classicMode" verb="*"
path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </handlers>
</system.webServer>

My route is configured as follows :

routes.Add("Article By Title", new Route("Articles/{*ArticleName}", new
ArticleRouteHandler()));

Anyone who can tell me what I've missed? It feels like I've overlooked the
obvious.

Cheers

Grant

Reply via email to