This is a migrated thread and some comments may be shown as answers.

String limit for HtmlSource?

4 Answers 84 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Stanescu Mihai
Top achievements
Rank 1
Stanescu Mihai asked on 25 Aug 2010, 03:23 PM
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.

4 Answers, 1 is accepted

Sort by
0
Accepted
Shaikh Ahmad
Top achievements
Rank 1
answered on 26 Aug 2010, 07:47 PM
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
    
}

 

0
Stanescu Mihai
Top achievements
Rank 1
answered on 27 Aug 2010, 08:52 AM
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.
0
Shaikh Ahmad
Top achievements
Rank 1
answered on 28 Aug 2010, 06:55 AM
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.
0
Kiril Stanoev
Telerik team
answered on 30 Aug 2010, 11:59 AM
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
Tags
HTMLPlaceHolder
Asked by
Stanescu Mihai
Top achievements
Rank 1
Answers by
Shaikh Ahmad
Top achievements
Rank 1
Stanescu Mihai
Top achievements
Rank 1
Kiril Stanoev
Telerik team
Share this question
or