Can't set SourceURL as String from Code

5 posts, 1 answers
  1. James
    James avatar
    9 posts
    Member since:
    Nov 2007

    Posted 16 Jul 2010 Link to this post

    In the declaritive side of HTMLPlaceHolder I can set the SourceURL as any string and it accepts it. But from code I have to directly supply a system.URI object.

    The problem for me is if I want to assign for example "http://telerik.com/page1.aspx?ID=net%2b2009" to the SourceURL. When I construct a system.URI from that string it removes the %2b encoding and replaces it with the unescaped +.

    Whether this is correct or not, and whether + should be encoded as part of a querystring becomes immaterial when the source we are trying to load requires it.

    It would be much easier if we could assign a string to the SourceURL property.
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 19 Jul 2010 Link to this post

    Hi James,

    Thank you for this suggestion - for the moment we will not change the property type. If there are other users complaining about that - we will provide an alternative way of setting this. If you need help with implementing a solution with the current binaries - please let us know.

    Kind regards,
    Valentin.Stoychev
    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
  3. DevCraft banner
  4. James
    James avatar
    9 posts
    Member since:
    Nov 2007

    Posted 19 Jul 2010 Link to this post

    Help would be great.

    We tried today to use binding instead of setting the property directly in code, unfortunately this still leads to the string http://telerik.com/page1.aspx?ID=net%2b2009 being changed to http://telerik.com/page1.aspx?ID=net+2009 which was a very disappointing moment.

    It seems the only way we can get the string to retain the escaping we desire is to set it declaratively, which doesn't work for us, because we need to be able to change it on the fly.

    As you can see here I can no longer create a URI where I control the escaping:

    http://msdn.microsoft.com/en-us/library/9zh9wcb3.aspx

    That constructor is now obsolete.

    Any other ideas?
  5. Answer
    Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 20 Jul 2010 Link to this post

    Hi James,

    You can use this code:

    RadHtmlPlaceholder1.HtmlPresenter.Children[0].SetProperty("src", "http://telerik.com/page1.aspx?ID=net%2b2009 ");




    Regards,
    Valentin.Stoychev
    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
  6. James
    James avatar
    9 posts
    Member since:
    Nov 2007

    Posted 20 Jul 2010 Link to this post

    Thanks, that works for us. Problem solved.

    However it would be a lot easier and less confusing if we could set the string directly...
Back to Top
DevCraft banner