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

RAdEditor within web browser component in a WIn Form

3 Answers 71 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Paul Yerre
Top achievements
Rank 1
Paul Yerre asked on 23 Apr 2010, 01:03 AM
I have a webpage that displays the RadEditor using the dialogs etc...it works fine.   When i view this page within a vb.net winform using the web broswer component..when i click to popup the image dialog..i get error web.config registration is missing?

But everything works fine when i view the page in IE

Any suggestion?

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 23 Apr 2010, 03:29 PM
Hi Paul,

I tested the attached project to this KB article Using RadEditor for ASP.NET AJAX in a Windows application and I was unable to reproduce the problem.

You can find information about the error in this KB article: Error: Web.config registration missing! The Telerik dialogs require a HttpHandler registration in the web.config file.

Best regards,
Rumen
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.
0
Rafael
Top achievements
Rank 1
answered on 09 Nov 2010, 12:44 PM
Hi!

I'm also trying to have a radEditor hosted ina winForm app "Content Editor-like".
The get_html is working fine but i'm unable to set the html on radEditor1:

private void SetHtml(string newHTML)
{
    string jsFunction = "function SetEditorHtml()  { "
                        + "var newValue = \"" + newHTML + "\" ;"
                        + " return $find('RadEditor1').set_html(newValue); }";
 
    IHTMLDocument doc1 = (IHTMLDocument) webBrowser2.Document.DomDocument;
    HTMLWindow2 iHtmlWindow2 = (HTMLWindow2) doc1.Script;
    //Register the scrit on The form
    iHtmlWindow2.execScript(jsFunction, "javascript");
    //call the function to get editor's text
    try
    {
        webBrowser2.Document.InvokeScript("SetEditorHtml");
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.ToString());
    }
}


What's wrong please?

Regards,

Rafael
0
Rafael
Top achievements
Rank 1
answered on 09 Nov 2010, 11:46 PM
Ok i found the solution:

private void SetHtml(string newHTML)
{
    string jsFunction = @"function SetEditorHtml(html) 
            {
                $find('RadEditor1').set_html(html);
            }";
 
    IHTMLDocument doc1 = (IHTMLDocument) webBrowser2.Document.DomDocument;
    HTMLWindow2 iHtmlWindow2 = (HTMLWindow2) doc1.Script;
 
    try
    {
        iHtmlWindow2.execScript(jsFunction, "javascript");
        object[] args = new object[1];
        args[0] = newHTML;
        webBrowser2.Document.InvokeScript("SetEditorHtml", args);
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.ToString());
    }
}
Tags
Editor
Asked by
Paul Yerre
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Rafael
Top achievements
Rank 1
Share this question
or