I am trying to execute spell checking on client sideusing checkTextComponent but it doesn't do anything. Here is the javascript method that does the work:
function checkSpelling() { var elem = getElementsByAttribute("SpellChecker", "True"); for(var i = 0; i < elem.length; i++) { var checker = ig_getWebControlById("<%=spellChecker.ClientID %>"); checker.checkTextComponent(elem.id); } }
elem has elements in it (I put an alert call in there to be sure), but whenever the script gets executed nothing happens. My declaration for the spellChecker object is like this:
<ig_spell:WebSpellChecker ID="spellChecker" runat="server"></ig_spell:WebSpellChecker>
All these elements are inside an UpdatePanel, but I don't know if that has anything to do with it. Any suggestions?
Ok so I figured this out. Putting the WebSpellChecker inside an update panel WITHOUT a "customized" WebSpellCheckerDialog page does not work and causes the exception above. However, after creating a Web Form with just a WebSpellCheckerDialog control in it and then associating the WebSpellChecker object with that page works.
I was a dummy here. Should have been
checker.checkTextComponent(elem[i].id);
Anyway, now the dialog pops up and I get this exception inside the window that just popped up:
RegisterForEventValidation can only be called during Render();
Here is the stack trace that accompanied it:
at System.Web.UI.ClientScriptManager.RegisterForEventValidation(String uniqueId, String argument) at System.Web.UI.HtmlControls.HtmlInputText.RenderAttributes(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlControl.RenderBeginTag(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) at Infragistics.WebUI.WebControls.WebPanelBase.RenderContents(HtmlTextWriter writer) at Infragistics.WebUI.WebControls.WebPanelBase.Render(HtmlTextWriter writer) at Infragistics.WebUI.WebSpellChecker.WebSpellCheckerDialog.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at Infragistics.WebUI.WebSpellChecker.WebSpellChecker.RenderDialog(HtmlTextWriter writer, WebSpellCheckerDialog dialog) at Infragistics.WebUI.WebSpellChecker.WebSpellChecker.RenderDialog(HtmlTextWriter writer) at Infragistics.WebUI.WebSpellChecker.WebSpellChecker.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.ControlCollection.Add(Control child) at System.Web.UI.UpdatePanel.CreateContents(Boolean recreate) at System.Web.UI.UpdatePanel.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.ControlCollection.Add(Control child) at OurPage.OnInit(EventArgs e) in C:\Projects\
Has anyone encountered this before?