+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / News and Events items all have a ReturnURL

News and Events items all have a ReturnURL

2 posts, 0 answered
  1. Mike
    Mike avatar
    22 posts
    Registered:
    05 Mar 2008
    30 Jun 2008
    Link to this post
    Any news item or events that we create all receive a ?ReturnURL=  tacked onto the end of them.

    Is there some way to turn this off? and How/why is this generated in the first place. The news items are on a publicly accessible page so there should not be any redirection involved and i do not need to use a querystring to get back to the previous page, as there is a back link builtin to the control template.

    If anyone knows how to turn this off or prevent it, I would greatly appreciate it.

    thanks,
    Mike
  2. Ivan
    Ivan avatar
    478 posts
    Registered:
    16 Jun 2015
    04 Jul 2008
    Link to this post
    Hi Mike,

    The ReturnURL query string is attached to the URL only when you are displaying single news (or event) on a page different than the one that displays list of news.

    The ReturnURL query string allows NewsView control to figure out on its own the ItemListUrl property (if you don't set it explicitly).

    I do see your point with not wanting to have the query string in the URL, so I am logging this as a feature request (an ability to turn it off through a property). I am sorry that we cannot help you more at the moment.

    Of course, you are always free to override the NewsView control and provider your own solution. You would need to override GetItemUrl along these lines:

    protected virtual string GetItemUrl(IContent contentItem, string singleItemUrl)  
    {  
        string myUrl = base.GetItemUrl(contentItem, singleItemUrl);  
        if(myUrl.IndexOf("?") > -1)  
        {  
           myUrl = myUrl.Substring(0, myUrl.IndexOf("?"));  
           return myUrl;  
        }  
        return myUrl;  


    Greetings,
    Ivan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
2 posts, 0 answered