WebTextEditor Load Dynamically an user control containing a WebTextEditor with fileuploader

17 replies. Last post: March 17, 2011 1:56 AM by Handy Surya
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hello,

I found a bug in WebTextEditor when using the integration with WebFileUploader.

What I was trying to do is to load dynamically an User Control in a panel of an .aspx page.

First, I tried to register my user control ("WebUserControl.acsx"), which did work fine:

<%@ Page Title="Integration with WebFileUploader" Language="C#" MasterPageFile="./DefaultMasterXHTML.master"
    AutoEventWireup="true" CodeFile="IntegrationWithWebFileUploader.aspx.cs" Inherits="WebTextEditor_IntegrationWithWebFileUploader" %>

<%@ Register Assembly="ISNet.WebUI.WebTextEditor" Namespace="ISNet.WebUI.WebTextEditor"
    TagPrefix="ISWebTextEditor" %>
<%@ Register Src="WebUserControl.ascx" TagName="UcUserControl" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="content" runat="Server">

<uc1:UcUserControl runat="server" ID="test"/>

</asp:Content>

Then, I tried to load dynamically the user control, by adding an asp:panel instead of directly the user control.

The goal is to load dynamically an user control in the asp panel, like the following :

<%@ Page Title="Integration with WebFileUploader" Language="C#" MasterPageFile="./DefaultMasterXHTML.master"
    AutoEventWireup="true" CodeFile="IntegrationWithWebFileUploader.aspx.cs" Inherits="WebTextEditor_IntegrationWithWebFileUploader" %>

<%@ Register Assembly="ISNet.WebUI.WebTextEditor" Namespace="ISNet.WebUI.WebTextEditor"
    TagPrefix="ISWebTextEditor" %>
<%@ Register Src="WebUserControl.ascx" TagName="UcUserControl" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="content" runat="Server">

    <asp:Panel ID="pnlTest" runat="server">
    </asp:Panel>

</asp:Content>

and by adding the following code in the code file:

Control ctrl = LoadControl("WebUserControl.ascx");
pnlTest.Controls.Add(ctrl);

Unfortunately, this second solution doesn't work causes an error : "Unable to initialize file uploader".

As we are working with a lot of different user controls, we can't afford to use the first solution. We MUST load our user controls dynamically.

I attached the User Control I Created and the updated page "IntegrationWithWebFileUploader.aspx" for loading the user control. In order to reproduce the problem, you can just integrate these files to VS2010 Solution WebTextEditor C# Samples.

Can you provide us with some help or send this case to your development team?

Best Regards,

Nicolas

1 attachment
All times are GMT -5. The time now is 7:54 PM.
Previous Next