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;
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...
Write your reply to:
Image will be uploaded when post is submitted