MCMS tip of the day – how to avoid ugly URLs in MCMS

There are two different reasons for ugly URL’s on in presentation mode:

  1. when using Webauthor and switching to live site
  2. when doing a postback in on a form to send data to the server.

The following articles discuss different ways to address this:

4 Comments


  1. Hi Stefan,

    We have a (large) customer that does not like the ugly URLs that are associated with resource gallery items.

    Are you aware of a similar solution for resource gallery items?

    Thanks,

    Christian

    Reply

  2. Hi Christian,

    that would mean a lot of effort.

    You need to implement an ISAPI filter that rewrites the nice URL to the Ugly one to allow MCMS to understand it.

    In addition you need to replace the standard webauthor dialog to insert the resource into the posting with the nice one.

    Or alternatively you need a HttpModule that replaces the link in the output stream with the nice one.

    Cheers,

    Stefan

    Reply

  3. Hi Stefan,

    I’ve implemented your HttpModule solution to the ugly URL problem (outlined in http://blogs.technet.com/stefan_gossner/archive/2004/04/23/118623.aspx). It’s implemented on an ASP.NET 2.0 website and it works great!

    However, if I add the following attribute to the Page directive on any of the ASPX pages:

    MaintainScrollPositionOnPostBack="true"

    Then any of the pages that include this attribute report a Javascript error during page load. The error is:

    Error: Webform_SaveScrollPositionSubmit is undefined.

    If I remove either your HttpModule, or the MaintainScrollPositionOnPostBack attribute then the pages work again.

    Have you come across this? Or, do you have any ideas what might be causing the clash?

    Thanks & regards,

    Dave.

    Reply

  4. Hi Dave,

    I haven’t used this property.

    It might be related to the fact that MCMS does not support smart navigation.

    Cheers,

    Stefan

    Reply

Leave a Reply to Stefan_Gossner Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.