This is a migrated thread and some comments may be shown as answers.

[Solved] ModalPopupExtender DynamicControlID telerik:RadEditor

1 Answer 170 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jeya Annanathan
Top achievements
Rank 1
Jeya Annanathan asked on 04 Nov 2009, 01:59 PM
Hi,

I'm using a RadEditor inside an asp:Panel which is displayed using an AJAX ModalPopupExtender.  In order to populate the content of the RadEditor I'm using a Web Service

Here is the ASPX code: 
<asp:LinkButton ID="lkbIntroText" runat="server">Intro Text</asp:LinkButton>  
<cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="lkbIntroText"  
    PopupControlID="PopUpPanel" BackgroundCssClass="modalBackground" DropShadow="true"  
    DynamicServicePath="SurveyIntroText.asmx" DynamicServiceMethod="GetSurveyIntroText"  
    DynamicControlID="RadEditor1" OkControlID="lbtOK" OnOkScript="onOk()">  
</cc1:ModalPopupExtender>  
<asp:Panel ID="PopUpPanel" runat="server" CssClass="modalPopup">  
    <asp:Panel ID="pnlWindowHeader" runat="server" CssClass="modalTop">  
        <div style="padding: 2px; height: 16px;">  
            <asp:Literal ID="ltlLabel" runat="server"></asp:Literal>  
            <asp:LinkButton ID="lbtOK" runat="server" Text="[ x ]" Style="height: 15px; float: right;  
                text-decoration: none;" />  
        </div>  
    </asp:Panel>  
    <div class="space20px">  
    </div>  
    <div>  
        <asp:Label ID="test" runat="server"></asp:Label>  
        <telerik:RadEditor ID="RadEditor1" runat="server" ToolbarMode="ShowOnFocus" ToolsFile="~/App_Data/RadControls/ConfigXML/default.xml"  
            Height="200">  
            <CssFiles>  
                <telerik:EditorCssFile Value="~/EditorContentArea.css" />  
            </CssFiles>  
        </telerik:RadEditor>  
    </div>  
    <div style="text-align: center;">  
        <asp:Button ID="btnSave" runat="server" Text="Save" OnClick="btnSave_Click" />  
        <asp:Button ID="btnCancel" runat="server" Text="Cancel" CausesValidation="false" />  
        <asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="button_delete"  
            CausesValidation="false" />  
    </div>  
</asp:Panel>  



Here is the Web Service:
<%@ WebService Language="C#" Class="SurveyIntroText" %>  
  
using System;  
using System.Web;  
using System.Data;  
using System.Data.SqlClient;  
using System.Web.Services;  
using System.Web.Services.Protocols;  
using Carswell.Web.Student.Modules.Survey;  
  
[WebService(Namespace = "http://tempuri.org/")]  
[System.Web.Script.Services.ScriptService]  
public class SurveyIntroText  : System.Web.Services.WebService {  
  
    [WebMethod]  
    public string GetSurveyIntroText()  
    {  
        SurveyResultsDb oS = new SurveyResultsDb();  
        SqlDataReader dr = oS.GetSurveyIntroText(30);  
        if (dr.HasRows)  
        {  
            dr.Read();  
            return dr["IntroText"].ToString();  
        }  
        else  
        {  
            return "";  
        }  
    }  
      


When I assign the DynamicControlID = "RadEditor1" in the ModalPopupEditor, it doesn't populate the Content of the RadEditor.  I need the data retrieved from the Web Service to populate the RadEditor.Content
Any ideas? 

Thank you,
Jeya

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 05 Nov 2009, 03:02 PM
Hi Jeya,

We believe that your scenario works fine with a standard input / textbox controls. RadEditor is however a composite control which content area is IFRAME and this scenario is not supported out-of-the box by the control.
What you should do is to populate the content of a hidden field using a Web Service and after that to set its value in the editor on the client using the editor's set_html method.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
Jeya Annanathan
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or