RadWebBrowserItem ScriptErrorsSuppressed

3 posts, 0 answers
  1. Developer Developer
    Developer Developer avatar
    34 posts
    Member since:
    Sep 2005

    Posted 16 Sep 2010 Link to this post

    I'm trying to suppress script errors in a RadWebBrowserItem.

    In System.Windows.Forms.WebBrowser there is a property named ScriptErrorsSuppressed, but I can't seem to find an equivalent in RadWebBrowserItem.

    Does anybody know if it's possible to suppress script errors in the RadRotator using a RadWebBrowserItem? 

    Thank you!
  2. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 21 Sep 2010 Link to this post

    Hello Developer,

    Thank you for this question.

    You can get the WebBrowser control hosted in RadWebBrowserItem using reflection as the property returning this control is currently internal:
    RadWebBrowserItem item1 = new RadWebBrowserItem();
    Type t = typeof(RadWebBrowserItem);
    PropertyInfo pInfo = t.GetProperty("WebBrowserControl", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
    object o = pInfo.GetValue(item1, null);
    WebBrowser browser = (WebBrowser)o;
    browser.ScriptErrorsSuppressed = true;

    We will consider making the WebBrowserControl public in one of our next releases.

    I hope this helps.

    Greetings,
    Nikolay
    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. UI for WinForms is Visual Studio 2017 Ready
  4. Developer Developer
    Developer Developer avatar
    34 posts
    Member since:
    Sep 2005

    Posted 21 Sep 2010 Link to this post

    That works great.  Thank you!
Back to Top