More in this section

Forums / Developing with Sitefinity / SEO Friendly URLS in Widget

SEO Friendly URLS in Widget

2 posts, 0 answered
  1. David
    David avatar
    16 posts
    Registered:
    10 Apr 2012
    09 Jan 2013
    Link to this post
    Are there any tips on creating dynamic SEO URLS in a custom widget?  I have it working fine with querystring variables, but would like to make it more SEO friendly.
    Thanks.
  2. Matt Licht
    Matt Licht avatar
    5 posts
    Registered:
    01 Aug 2012
    09 Jan 2013
    Link to this post
    You need to notify the route handler that the control on the page is expecting URL parameters to be resolved. To achieve this, you need to set the UrlParamtersResolvedKey in the 
    CurrentHttpContext.Items collection.  It needs to be done in an early stage of the control lifecycle. Here's some code to help you.

    protected override void OnInit(EventArgs e)
           {
               base.OnInit(e);
               RouteHelper.SetUrlParametersResolved();
           }
           protected void Page_Load(object sender, EventArgs e)
           {
               var param = this.GetUrlParameterString(true);
               ParamLiteral.Text = param;
           }
2 posts, 0 answered