Home Search Member List Faq Register Login  
UltimateEditorMVC
IE is not posting all UltimateEdit fields causing GetEditorHtml to throw an Exception

Thread Starter: Arkiliknam   Started: 06-28-2013 7:55 AM   Replies: 9
 Karamasoft Support Forums » General Discussions » UltimateEditorMVC » IE is not posting all UltimateEdit fields causing GetEditorHtml to throw an Exception
 Printable Version    « Previous Thread   Next Thread »
  28 Jun 2013, 7:55 AM
Arkiliknam is not online. Last active: 1/12/2015 7:47:33 AM Arkiliknam

Top 10 Posts
Joined on 06-28-2013
Posts 13
IE is not posting all UltimateEdit fields causing GetEditorHtml to throw an Exception
Code works fine in Firefox. However in IE, GetEditorHtml(myId) is throwing a NullReferenceException. What is odd is that with the same view with different data in the model, sometimes it does and sometimes it does not. But there is nothing suspicious in either of the models.

Using Firebug and IE Dev tools I noticed that Firefox always posts all the fields as expected, however IE is not posting certain fields.

As a result, we are unable to rely on UltimateMVC for MVC ModelBinding.

Is there a known issue/workaround for IE? Are there some cases where UltimateEditMVC renders something parsable by Firefox but not by IE?

This occurs within a stock standard:
@using (Html.BeginForm("Save", Model.Controller, new { id ="Form" }))

rendering the controls like:

@(Html.UltimateEditorMVC()
                                .EditorHtml(Model.Person.PersonComments ?? string.Empty)
                                .EditorSource("~/UltimateEditorInclude/UltimateEditorBasic.xml")
                                .Theme("Standard")
                                .ID("PersonComments")
                                .TextBoxHeight("150px")
                                .FormID("Form")
                                .DisplayCharCount(false)
                                .MaxCharCount(-1)
                                .DisplayWordCount(false)
                                .MaxWordCount(-1)
                                .Width(System.Web.UI.WebControls.Unit.Percentage(100))
                                .DesignTabVisible(false)
                                .HtmlTabVisible(false)
                                .PreviewTabVisible(false)
                                .Resizable(false)
                                .SetFocus(false)
                                .Render())

Error is:
   at Karamasoft.Html.UltimateEditorMVC.UltimateEditorMVCAPI.GetEditorHtml(String editorID)


This is most frustrating as it only happens in 5% of the cases, but from my analysis I can't determine why.

Andre

  
  28 Jun 2013, 11:13 AM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: IE is not posting all UltimateEdit fields causing GetEditorHtml to throw an Exception
What fields are missing during your post? One difference between IE and Firefox is that the SpellAsYouType feature works only in IE. Did you enable it by any chance? Does it make a difference when you disable that feature?
  
  01 Jul 2013, 1:48 AM
Arkiliknam is not online. Last active: 1/12/2015 7:47:33 AM Arkiliknam

Top 10 Posts
Joined on 06-28-2013
Posts 13
Re: IE is not posting all UltimateEdit fields causing GetEditorHtml to throw an Exception
We discovered why the bug was occurring.

Somehow an HTML form element got into the text of the UltimateEditorMVC control. The tag itself was not visible when rendered by the control but existed in the raw text. We're not sure whether UltimateEditorMVC itself put it in there, but sure enough it was there.

Is it possible that UltimateEditorMVC cleans all non essential tags from the text before rendering/posting it?

  
  01 Jul 2013, 2:15 AM
Arkiliknam is not online. Last active: 1/12/2015 7:47:33 AM Arkiliknam

Top 10 Posts
Joined on 06-28-2013
Posts 13
Re: IE is not posting all UltimateEdit fields causing GetEditorHtml to throw an Exception
Looking further, it seems that users have pasted text from other html pages which included form tags among others. I see that UltimateEditorMVC has a property called AutoCleanWordFormatOnPaste , I think it sensible that there is another one for cleaning HtmlOnPaste. Is there any possibility that this feature is implemented and released any time soon?

  
  01 Jul 2013, 2:27 AM
Arkiliknam is not online. Last active: 1/12/2015 7:47:33 AM Arkiliknam

Top 10 Posts
Joined on 06-28-2013
Posts 13
Re: IE is not posting all UltimateEdit fields causing GetEditorHtml to throw an Exception
Also, since this data has now made its way into our DB, it would be handy to have the option of cleaning it onRender so that old data can also be cleaned.

  
  01 Jul 2013, 8:19 AM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: IE is not posting all UltimateEdit fields causing GetEditorHtml to throw an Exception
Are you trying to clean all HTML tags? If so, there is a button called Remove Format that the HTML tags. Otherwise, there is no way UltimateEditor can guess which specific HTML tags you would want to remove on paste. If you want to make custom checks on what user has pasted, you can also add the beforepaste event handler by using the AddEventHandler client-side API method.
  
  03 Jul 2013, 7:37 AM
Arkiliknam is not online. Last active: 1/12/2015 7:47:33 AM Arkiliknam

Top 10 Posts
Joined on 06-28-2013
Posts 13
Re: IE is not posting all UltimateEdit fields causing GetEditorHtml to throw an Exception
Basically, your control allows the pasting of form and input html tags which when rendered jeopardizes MVC's Model Binding. Considering this is an MVC control, is this not an important issue to handle out of the box?

  
  03 Jul 2013, 8:01 AM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: IE is not posting all UltimateEdit fields causing GetEditorHtml to throw an Exception
We tested adding form and input elements using the UltimateEditor toolbar buttons and also by typing in HTML tab and saved the editor content and it didn't cause any errors with the GetEditorHtml method. Please make sure that your users are pasting valid HTML elements.
  
  10 Jul 2013, 6:18 AM
Arkiliknam is not online. Last active: 1/12/2015 7:47:33 AM Arkiliknam

Top 10 Posts
Joined on 06-28-2013
Posts 13
Re: IE is not posting all UltimateEdit fields causing GetEditorHtml to throw an Exception
Can this validation not be added as a feature request? The validation is on input to the Karamasoft control so it seems sensible to me that the Karamasoft control has options to validate these of occurrences.

  
  10 Jul 2013, 10:26 AM
Karamasoft is not online. Last active: 5/8/2018 10:36:45 AM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,820
Re: IE is not posting all UltimateEdit fields causing GetEditorHtml to throw an Exception
We will add your feature request but we can't promise when or if this feature will be implemented at this point. Sorry for the inconvenience.
  
 Page 1 of 1 (10 items)
Karamasoft Support Forums » General Discussions » UltimateEditorMVC » IE is not posting all UltimateEdit fields causing GetEditorHtml to throw an Exception

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2018 Karamasoft LLC. All rights reserved.