Developer forum

Forum » Development » Ignore specific routes

Ignore specific routes

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

I am building a custom minifier and bundler using less and need Dynamicweb to skip certain paths. I currently have the following in my Global.asax:

if (string.IsNullOrEmpty(Request.AppRelativeCurrentExecutionFilePath) || !Request.AppRelativeCurrentExecutionFilePath.ToLower().Contains("bundle"))
{
  Dynamicweb.Frontend.GlobalAsaxHandler.Application_AuthenticateRequest(sender, e);
}


This works great and bypasses URLs with bundle in their name.

But is there another way to do this using a subscriber or something like that maybe? I'd like to create a drop-in DLL that I can just add to a project without writing additional code in Global.asax

 

Thanks,

Imar


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Imar

You can use the Notifications.Standard.Application.AuthenticateRequest notification and set the Handled property to true on the passed Notifications.Standard.Application.AuthenticateRequestArgs instance.

When you do that, Dynamicweb will bypass its own URL handling and URL rewriting stuff.

BR Nicolai

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Perfect, exactly what I needed.....

Imar

 

 

You must be logged in to post in the forum