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

Forums / Bugs & Issues / trouble with hyperlinks

trouble with hyperlinks

11 posts, 0 answered
  1. Orion
    Orion avatar
    54 posts
    Registered:
    02 Feb 2009
    28 Sep 2009
    Link to this post
    We are trying to create a hyperlink structure like so: 

    http://www.domainname.org/NFRoute.aspx?p=https%3a%2f%2fwww.netforumondemand.com%2feWeb%2fDynamicPage.aspx%3fSite%3dACA%26WebCode%3dIndSearch

    But when you click on the link, Sitefinity appears to be stripping out the % signs, which screws up the link.  PLEASE tell me there's a way to stop Sitefinity from doing this.

    Thanks,
    Orion
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    29 Sep 2009
    Link to this post
    Hello Orion,

    I am not sure that I understood your question.

    Where do you insert this links? How do you create them? Could you please let us know about the exact steps that you are taking?

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Orion
    Orion avatar
    54 posts
    Registered:
    02 Feb 2009
    29 Sep 2009
    Link to this post
    I've seen this problem two ways.

    1.  Created a new page.  Instead of Normal page or Page group, it's set to external link at ConstantContact, and that link has % signs in it.  We created a control that creates a drop-down list consisting of a group of pages, including this one.  When you choose that page though, it appears to strip out the % signs, and takes you to a ConstantContact error page.

    2.  In a generic content block, I inserted an image to serve as a button.  This button was set to a hyperlink using the standard editor in Sitefinity, but when you click on the button, it strips out the % signs and doesn't take you to the right location.

    These issues appear the same or related, but they are with two different clients with two different installs of Sitefinity.
  4. Orion
    Orion avatar
    54 posts
    Registered:
    02 Feb 2009
    30 Sep 2009
    Link to this post
    After some testing, I finally have a good idea what's happening, but I still have no idea if it's possible to change/fix. 

    Basically, Sitefinity knows how to automatically decode things.  So no matter what, if I try using an encode url for a link, Sitefinity is automatically decoding it as soon as I save the page.

    I even double encoded a url and it decoded it down to a single level of encoding upon saving the page.  Going into edit mode again and saving without changing anything, stripped off the rest of the encoding.

    I basically need to know if there's any way to configure Sitefinity to not decode at all.  Or at least not on URLs I'm specifying.

    Thanks,
    Orion
  5. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    02 Oct 2009
    Link to this post
    Hi Orion,

    Thank you for the additional details. 

    I replicated the problem and have a clue about it - it is the way we resolve links. There is a ResolveLink class for this purpose. Unfortunately there is no easy way here, to override the class itself. Still there is a workaround. You can override some render method, so when the page is rendered you are looking for backslash and & and replace them with the unescaped characters.

    I will try to follow up on Monday if this is not enough as information. 

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Orion
    Orion avatar
    54 posts
    Registered:
    02 Feb 2009
    02 Oct 2009
    Link to this post
    We think we understand what you mean, but we're not familiar with handling that kind of functionality.  If you are able to provide further details on Monday, that would be wonderful.

    Thanks,
    Orion
  7. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    05 Oct 2009
    Link to this post
    Hi Orion,

    Alright, here is how to replace symbols on each request on any Sitefinity page:

    AllCMS pages in Sitefinity inherit from the class InternalPage. I will show youhow you can create a class that overrides this class.

    1.Create a new class - InternalPageTweak in the App_Codedirectory:

    using System; 
    using System.Collections.Generic; 
    using System.Linq; 
    using System.Web; 
    using Telerik.Cms.Web; 
    using System.Web.UI; 
    using System.IO; 
     
    /// <summary> 
    /// Summary description for InternalPageTweak 
    /// </summary> 
    namespace Telerik.Samples 
        public class InternalPageTweak : InternalPage 
        { 
            protected override void Render(HtmlTextWriter writer) 
            { 
                HtmlTextWriter output = new HtmlTextWriter(new StringWriter()); 
     
                base.Render(output); 
                string outputString = output.InnerWriter.ToString().Replace("this""with that"); 
     
                writer.Write(outputString); 
            } 
        } 

    2.Make sure all pages inherit from this class now:

    ~/yourproject/Sitefinity/cmsentrypoint.aspx

    <%@ Page Inherits="Telerik.Samples.InternalPageTweak" MasterPageFile="~/Sitefinity/Dummy.master" %> 

    Note the highlighted line in step 1. This is where the replace statements should be done.

    All the best,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  8. Brimaka
    Brimaka avatar
    6 posts
    Registered:
    08 Nov 2009
    17 Dec 2009
    Link to this post
    Hi there,

    I am encountering this issue as well, and am just wondering if there have been any new breakthroughs on resolving the issue?  When linking to external pages such as Amazon, a URL frequently has character encoding that cannot be tampered with. 

    For example, http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2Fs%3Fie=UTF8%26field-keywords=clocks.

    If I include a link such as this in a Generic Content container, it decodes the escaped characters and saves something like http://www.amazon.com/s?ie=UTF8&field-keywords=clocks.  When this link is clicked, it simply does not take a user to the correct page - the encoded version is required (please do not use my example here as a literal example, as clicking that second link probably works to a degree...the scenario I'm describing here is valid though).

    Is there a way, other than overriding the functionality in the Inherit page, that a Generic Content can ignore decoding (i.e. prevent the replacement of something http%3A%2F%2F to http://)?

    Thanks
  9. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    18 Dec 2009
    Link to this post
    Hi Brimaka,

    Unfortunately we do not have another workaround for the time being. We are thinking how to prevent this browser behavior though. 

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  10. Bart Welch
    Bart Welch avatar
    64 posts
    Registered:
    10 Jul 2009
    12 Nov 2010
    Link to this post
    Have any additional items of fixes been made to accommodate the need for using the url encoding with the links within Sitefinity?

    We have links where we need to use url endoding, specifically %26, in order for our pages to work properly.
  11. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    13 Nov 2010
    Link to this post
    Hello Bart Welch,

    I have responded to you in your original thread. For the convenience of our community here is my response again:
    We had such an issue with Sitefinity 3.x versions. The urls were decoded back to the actual values. You can test this on our on-line demo site. This issue has been resolved in our latest SP release. You can check the release notes here. To fix the issues you will have to upgrade to the latest 3.x SP following the upgrade instructions.

    Sincerely yours,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
11 posts, 0 answered