Last post Sep 28, 2009 08:51 AM by xeonix
Sep 24, 2009 11:38 AM|xeonix|LINK
i have some problem with modules...
in my project i'm using both url rewriting and request routing features, but i need to specify the order of module execution.
in web.config i wrote:
<add name="UrlRoutingModule" preCondition="integratedMode" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=188.8.131.52, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="UrlRewriterParserModule" preCondition="integratedMode" type="YottosCatalog.Modules.UrlRewriterParserModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=184.108.40.206, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
well, as i said, i have two modules.
i need "UrlRoutingModule" to execute first, and only if no route found, "UrlRewriterParserModule" executes.
i thought, that order of module execution is the same as the order i'm adding modules
to web.config, but it's not working - "UrlRewriterParserModule" allways executes first.
so, is there any way to specify the order of module execution (not in code, but in web.config)?
asp .net 2.0 .NET IHttpModule HttpModule Request Routing execution order urlrewriting
Sep 28, 2009 08:13 AM|docluv|LINK
Are both modules handling the same ASP.NET events? Or is the one you want to execute 2nd handing an event in the pipeline before the event handler of the one you want to execute 1st? Even if you list them in order int he config that does not change the event
pipeline, the events fire in the same order and only once for the request.
Have you tried changing the order in the web.config to see if that changes things.
Sep 28, 2009 08:51 AM|xeonix|LINK
Are both modules handling the same ASP.NET events? - yes, excactly the same event "BeginRequest"
Have you tried changing the order in the web.config to see if that changes things. - yes, i tried, but i didn't help, that's why i started this thread.
also i thought, that they are executing in alphabetical order, so i renamed them in web.config, so the first one will be UrlRoutingModule,
but also didn't help.
now i'm suppressing execution of event handlers programically, so it works, but is there any way to do this in config...