SEO Friendly URLS in Widget

Posted by Community Admin on 04-Aug-2018 19:52

SEO Friendly URLS in Widget

All Replies

Posted by Community Admin on 09-Jan-2013 00:00

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.

Posted by Community Admin on 09-Jan-2013 00:00

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;
       

This thread is closed