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
