Content Management System (CMS) and rewrite URL

by lichen 1/30/2006 4:23:00 PM

Many CMS uses friendly paths and the RewritePath method to rewrite a friendly path to a more cryptic path that contains a query string. A common problem is that the web form is then posted to the cryptic path rather the user friendly path. A workaround can be found at this post.

The solution is to call RewritePath again in the OnLoad event. In CMS, it is quite typical that all pages are inherited from a custom base class derived from the Page class. We can override the custom base class to call RewritePath again, like:

Context.RewritePath(path, null, query);

Note that it is important to pass “” to query parameter if there is no query string. It will not behave correctly if we pass null.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

.Net | ASP.NET

Related posts

Comments are closed

Powered by BlogEngine.NET 1.2.0.0
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  September 2010  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar

Pages

    Recent comments

    Authors

    Tags

      Disclaimer

      The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

      © Copyright 2010

      Sign in