SEO Friendly URLS in Widget
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.
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;