Problem with Double Quote Inside the SourceUrl of a RadHtmlPlaceHolder

7 posts, 0 answers
  1. Junlan
    Junlan avatar
    2 posts
    Member since:
    Mar 2012

    Posted 29 Mar 2012 Link to this post

    If there is a double quote inside the SourceUrl of a RadHtmlPlaceHolder, the url will be trimmed. For example,
    when SourceUrl = " http://duckduckgo.com?q=renewable energy ""2012""", in the iFrame it would be src=http://duckduckgo.com?q=renewable engery . I've also tried  " http://duckduckgo.com?q=renewable energy %222012%22". It doesn't work as well. Is there a way to insert double quotes into the SourceUrl?

     

  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 03 Apr 2012 Link to this post

    Hello JunLan,

     The SourceUrl is of type System.Uri so the problem is more related to escaping "" - two adjacent double quotation marks in Uri. I believe that ""5555"" should be replaced with %22%225555%22%22 but not 
    %225555%22. Hope this helps you.

    Kind regards,
    Petar Mladenov
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. DevCraft banner
  4. Junlan
    Junlan avatar
    2 posts
    Member since:
    Mar 2012

    Posted 03 Apr 2012 Link to this post

    Petar,

    Thank you for your reply. I tried "%22%22renewable energy%22%22" both in the xaml and the code behind. It doesn't work. Could you try that to see if it works?
  5. Maksym
    Maksym avatar
    7 posts
    Member since:
    Apr 2011

    Posted 05 Apr 2012 Link to this post

    Hi,

    I have a similar problem with escaping of characters in SourceUrl property.

    My guess is that RadHtmlPlaceholder uses SourceUrl.ToString() instead of SourceUrl.AbsoluteUri when providing uri to iframe.

    Best Regards,
    Maksym
  6. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 06 Apr 2012 Link to this post

    Hello Maksym and Junlan,

    The RadHtmlPlaceholder gives to the underlying iframe the Uri.OriginalString. Check the following lines:

     Uri uri = new Uri("http://abbbb.com:/aa%22%22renewable energy%22%22");
    Debug.WriteLine(uri.OriginalString);
    This Prints: http://abbbb.com:/aa%22%22renewable energy%22%22 This will be the string passed to the iframe src property.

    Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  7. Maksym
    Maksym avatar
    7 posts
    Member since:
    Apr 2011

    Posted 06 Apr 2012 Link to this post

    Hello Petar,

    I rechecked (with Fiddler), and at least on version 2011.2.1004.1040 of Telerik controls it doesn't use Uri.OriginalString.
    It behaves as if it uses SourceUrl.ToString().

    Best Regards,
    Maksym
  8. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 11 Apr 2012 Link to this post

    Hello Maksym,

     You are right. Indeed, in Q2.2011.1004 the RadHtmlPlaceholder gives the underlying Iframe SourceUrl.ToString(). The SourceUrl.OriginalString is change introduced in the official Q1 2012 (0215).
    Please excuse me for not explaining this correctly.

    All the best,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner