Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I am trying to create some URLRewriting rules in the ApplicationStarted event handler, but they don't seem to be added to httpHandlers collection.
I can't do this in the URLRewriting.config file as I need to get some info from the content nodes. The code I am using is:
rule = new UrlRewritingNet.Web.RegExRewriteRule(); rule.VirtualUrl = "^~/blog/page/(.*)"; rule.RewriteUrlParameter = UrlRewritingNet.Web.RewriteUrlParameterOption.ExcludeFromClientQueryString; rule.DestinationUrl = "~/blog?p=$1"; rule.IgnoreCase = true; UrlRewritingNet.Web.UrlRewriting.AddRewriteRule(Articulate_Paging", rule);
When I check the rewriting collection at UrlRewritingNet.Web.UrlRewriting.Configuration.Rewrites the new rule has not been added. Is anyone else adding rewrite rules programtically? Do I have to add them during a specific event?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Programatically creating UrlRewritingNet Rules
I am trying to create some URLRewriting rules in the ApplicationStarted event handler, but they don't seem to be added to httpHandlers collection.
I can't do this in the URLRewriting.config file as I need to get some info from the content nodes. The code I am using is:
When I check the rewriting collection at UrlRewritingNet.Web.UrlRewriting.Configuration.Rewrites the new rule has not been added.
Is anyone else adding rewrite rules programtically? Do I have to add them during a specific event?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.