Basically I have WebHtmlEditor and WebCurrenty Editor in a usercontrol which for testing i called "ctlEditOffer", that control is hidden by default:
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
<uc1:ctlEditOffer ID="ctlEditOffer1" runat="server" Visible="false" />
</ContentTemplate>
On the code behind for Button1 is the following code:
When Button1 is clicked, it correctly shows the control with the Infragistics editors, along with a javascript error "Object Expected"
so basically you cannot do anything with the infracontrols.
What I think its happening is not loading the javascript files required for the controls if there are in a UpdatePanel, any ideas?
Thanks
Has there been a solution to this? This appears to be an issue.
This issue has to do with when the control's JavaScript gets registered.
When you set a control's Visible property to false, it is not rendered to the HTML sent to the browser when the page is first requested. Not only does the user control not appear on the page, it essentially "doesn't exist" as far as the page is concerned.
When you click the button, you're doing an AJAX callback through the UpdatePanel. This renders the HTML for the user control and its child controls. UpdatePanel can't also send along the JavaScript for our editors, however, since our editors register their JavaScript in the HEAD element of the page.
The best solution is to hide your user control using CSS, rather than using the Visible property. By doing this, the user control will still be rendered to the HTML of the page, including the JavaScript for our controls. This will allow our controls to function in this scenario.
Another option is to find some other way to register the JavaScript for our controls, such as by manually referring to the correct JavaScript files, or having another (hidden) instance of each of the relevant controls outside of the UpdatePanel.
My editor is visible from page load and i still have the issue. I have tried adding duplicate controls outside of the update panel and that didn't work either as suggested. I will try registering each js file.