String limit for HtmlSource?

5 posts, 1 answers
  1. Stanescu Mihai
    Stanescu Mihai avatar
    33 posts
    Member since:
    Aug 2009

    Posted 25 Aug 2010 Link to this post

    Hello, I have a problem with the HtmlPlaceholder, when setting the htmlsource to a rather large string ( arround 100.000 characters), the htmlplaceholder doesn't display the entire string, the scrollbar stops at about 10% of the way down. I have checked with the word counter and it displays about 11.000 characters. Any know issues or workarounds?

    Also the htmlplaceholder is inside a tabcontrols tabitem.

    One more issue; after I select a different tabitem I get the following error:
    "Line: 1
    Error: 'RadHtmlPlaceholderJS' is undefined"

    I figured out the solution for the first problem, it was actually a faulty string, I had a couple of unopened closing tags. But for my second problem I don't have any ideea.
  2. Answer
    Shaikh Ahmad
    Shaikh Ahmad avatar
    20 posts
    Member since:
    Oct 2012

    Posted 26 Aug 2010 Link to this post

    I've came across this error before.You need to set the HtmlSource after the UrlLoaded in the PlaceHolder.
    The error happens because you are trying to set the HtmlSource before the PlaceHolder loads.
    Hope this helps.
    This is how I've done this.

     

    public partial class AnswerOptionForm : UserControl 
    {    
        public AnswerOptionForm() 
        {
          InitializeComponent();
          Loaded += new RoutedEventHandler(AnswerOptionForm_Loaded);    
        
      
        //Wait for the UI to load
        void AnswerOptionForm_Loaded(object sender, RoutedEventArgs e) 
        {
            this.htmlPlaceHolder.UrlLoaded += new EventHandler(editorAnswer_UrlLoaded); 
        }
      
        //Wait for URL Specified to the HTMLPlaceHolder to load.
        void editorAnswer_UrlLoaded(object sender, EventArgs e) 
        {
            //Set Your HtmlSource here
        
    }

     

  3. DevCraft banner
  4. Stanescu Mihai
    Stanescu Mihai avatar
    33 posts
    Member since:
    Aug 2009

    Posted 27 Aug 2010 Link to this post

    The problem is that I am not setting any SourceUrl, I just want to write a html formated string with HtmlSource. And so the UrlLoaded event does not fire.

    Never mind, I set the UrlSource to "_blank"; relative and the it worked.
  5. Shaikh Ahmad
    Shaikh Ahmad avatar
    20 posts
    Member since:
    Oct 2012

    Posted 28 Aug 2010 Link to this post

    Mihai,

    Even though you are assigning the HTMLSource instead of SourceUrl, you still have to wait for the UI to load before assigning the HTMLSource.You can neglect the UrlLoaded since its not being used.I think there is no need for you to set the SourceUrl if it is not needed.
  6. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 30 Aug 2010 Link to this post

    Hi guys,

    I am not able to reproduce the issue you describe. I've attached a sample project that shows RadHtmlPlaceholder displaying a string which is long 100,000 word (588,888 characters) without any problem (besides the fact that it takes some time to assign the string). Could you please have a look at the attached project and let me know if I am missing something. I'd be glad to further assist you.

    All the best,
    Kiril Stanoev
    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
Back to Top
DevCraft banner