Add current query string to NiceUrl and NiceUrlWithDomain methods
Is it possible to extend methods of the UmbracoHelper class?
You have the NiceUrl() and NiceUrlWithDomain() methods, but wouldn't it be better to also add a param to add the current query string in this url?
I have a page with some filtering and I would like to store this querystring also into the url of the child page. Then on the child page I have a button Return to list which then takes the filtering from the url to show the results based on this filtering.
In this way the user doesn't need to select all of his filtering again.
Now I have fixed this just by taking the string of the NiceUrlWithDomain() method and added the Request.Url.Query at the end.
But I will need to do this on several locations so maybe there is a better way of doing this?
Add current query string to NiceUrl and NiceUrlWithDomain methods
Is it possible to extend methods of the UmbracoHelper class?
You have the
NiceUrl()
andNiceUrlWithDomain()
methods, but wouldn't it be better to also add a param to add the current query string in this url?I have a page with some filtering and I would like to store this querystring also into the url of the child page. Then on the child page I have a button
Return to list
which then takes the filtering from the url to show the results based on this filtering.In this way the user doesn't need to select all of his filtering again. Now I have fixed this just by taking the string of the
NiceUrlWithDomain()
method and added theRequest.Url.Query
at the end.But I will need to do this on several locations so maybe there is a better way of doing this?
Hi,
you can add your own extensions to UmbracoHelper. you can build a class with the extension methods in them. (put it in the app_code folder)
should do it, but don't just append the query string. that way cross site scripting lies. good browsers do help. but
is the type of thing people can then embedd in your webpage.
is working on a reply...