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

[Solved] Using a Radeditor control in an MVC app

8 Answers 200 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Eugene
Top achievements
Rank 1
Eugene asked on 06 Apr 2010, 10:58 PM
Greetings,
    All attempts to retrieve content from the RadEditor control have returned the null value despite seeing the control work in the MvcForum sample.  Could you please tell me what is missing in the following:

My Index.aspx page:

<%

@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

 

 

<

 

asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">

 

Home Page

</

 

asp:Content>

 

<

 

asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">

 

<

 

script type="text/javascript">

 

 

function submitbtn() {

 

$.ajax({

type:

"POST",

 

url:

"/Home/Index",

 

data: ({ dummy:

"100" }),

 

dataType:

"json",

 

success:

function() {

 

alert(

"OK");

 

},

error:

function() {

 

alert(

"Failed");

 

}

});

}

</

 

script>

 

 

<h2><%= Html.Encode(ViewData["Message"]) %></h2>

 

 

<p>

 

To learn more about ASP.NET MVC visit

<a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.

 

 

</p>

 

 

 

<form id="MyForm" runat="server" action="/Home/Index.aspx">

 

 

<asp:ScriptManager ID="ScriptManager1" runat="server">

 

 

</asp:ScriptManager>

 

<%

= Html.TextBox("title", null, new { id="textbox" })%>

 

 

 

<telerik:RadEditor runat="server" ID="RadEditor1" />

 

 

 

<div id="actions">

 

 

<input type="button" value="Post" id="postingButton" onclick="submitbtn()"/> or <%= Html.ActionLink("go back", "Index/100") %>

 

 

</div>

 

 

</form>

 

</

 

asp:Content>

 

My HomeController:

using

 

System;

 

using

 

System.Collections.Generic;

 

using

 

System.Linq;

 

using

 

System.Web;

 

using

 

System.Web.Mvc;

 

using

 

Telerik.Mvc.Web.Helpers;

 

namespace

 

MvcRadEdit.Controllers

 

{

[

HandleError]

 

 

public class HomeController : Controller

 

{

[

AcceptVerbs(HttpVerbs.Get)]

 

 

public ActionResult Index()

 

{

ViewData[

"Message"] = "Welcome to ASP.NET MVC!";

 

 

return View();

 

}

[

AcceptVerbs(HttpVerbs.Post)]

 

 

public ActionResult Index(string dummy)

 

{

 

var htmlContent = RadControlHelper.ExtractHtmlValue(Request, "RadEditor1");

 

 

return Content(htmlContent);

 

}

 

public ActionResult About()

 

{

 

return View();

 

}

}

}


My WebConfig has the following, which was copied from the MvcForum sample:

<

 

httpHandlers>

 

<

 

add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false"/>

 

<

 

add path="Telerik.Web.UI.DialogHandler.axd" verb="*" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI" validate="false"/>

 


and

<

 

handlers>

 

<

 

add name="Telerik.Web.UI.WebResource.axd" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" preCondition="integratedMode"/>

 

<

 

add name="Telerik.Web.UI.DialogHandler.axd" path="Telerik.Web.UI.DialogHandler.axd" verb="*" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI" preCondition="integratedMode"/>

 


References: Telerik.web.Mvc and Telerik.Web.UI, both of version 2009.1.402.35.

Thank alot in advance, this is driving me to drink.
Eugene


8 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 07 Apr 2010, 08:19 AM
Hi Eugene,

This is not working because the $.ajax method does not automatically submit all form values. However I managed to get it working like this:

<telerik:RadEditor runat="server" ID="RadEditor1" />
 
<script type="text/javascript">
    function submitbtn() {
        $.ajax({
            type: "POST",
            url: "/Home/Index",
            data: ({ html: $find('<%=RadEditor1.ClientID %>').get_html() }),
            dataType: "json",
            success: function() {
                alert("OK");
            },
 
            error: function() {
                alert("Failed");
            }
        });
    }
 
</script>
 
<input type="button" value="Post" id="postingButton" onclick="submitbtn()" />
[AcceptVerbs(HttpVerbs.Post)]
[ValidateInput(false)]
public ActionResult Index(string html)
{
    return Json(new { html });
}

Greetings,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Eugene
Top achievements
Rank 1
answered on 07 Apr 2010, 04:24 PM
Hello Atanas,
    Thank you for your prompt reply.  It appears that your solution works if the user types a word or sentence in the RadEditor control.  However, it does not seem to work if the user introduces html into the control, such as adding newline characters (<br>), or bold attributes (<STRONG>), etc.  Is there a way around this problem?

Best Regards,
Eugene
0
Atanas Korchev
Telerik team
answered on 08 Apr 2010, 07:39 AM
Hi Eugene,

This seems to work fine at my end. I am sending you a sample application.

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Eugene
Top achievements
Rank 1
answered on 08 Apr 2010, 02:22 PM
Hello Atanas,    
    OK.  I see the difference in the apps.  It is the

[ValidateInput(false)] that you have inserted before the Index action.
Thanks alot,
Eugene

 

0
Jim
Top achievements
Rank 1
answered on 06 May 2010, 02:52 AM
Hi Atanas,
I'm am trying to use the example you included to add the radEditor to my project.  I was able to get yours to run without any problem.  When I run mine I get the following error message:
The control with ID 'RadEditor1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.  
 I am including my view page, controller, and web.congig in hopes that you might be able to point me in the right direction.  I haven't made any changes to the controller yet, as I am just trying to get the editor to display in the view.  Also, can I select or de-select features of the editor.  I don't require all the toolbars for example.

View
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PAO17.Services.PostModel>" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">  
    CreatePost  
</asp:Content> 
 
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">  
 
    <h2>CreatePost</h2> 
 
    <%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %> 
 
    <% using (Html.BeginForm()) {%> 
 
        <fieldset> 
            <legend>New Post</legend> 
            <p> 
                <label for="ParentPostId">ParentPostId:</label> 
                <%= Html.TextBox("ParentPostId") %> 
                <%= Html.ValidationMessage("ParentPostId", "*") %> 
            </p> 
            <p> 
                <label for="Title">Title:</label> 
                <%= Html.TextBox("Title", string.Empty, new { style = "width:450px"})%> 
                <%= Html.ValidationMessage("Title", "*") %> 
            </p> 
        </fieldset> 
<%--            <script src="../../Scripts/jquery-1.3.2.js" type="text/javascript"></script>--%> 
            <form action="/Forum/CreatePost" method="post">  
                <telerik:RadEditor runat="server" ID="RadEditor1" /> 
                <script type="text/javascript">  
                    function submitbtn() {  
                        $.ajax({  
                            type: "POST",  
                            url: "/Home/Index",  
                            data: ({ html: $find('<%=RadEditor1.ClientID %>').get_html() }),  
                            dataType: "json",  
                            success: function() {  
                                alert("OK");  
                            },  
 
                            error: function() {  
                                alert("Failed");  
                            }  
                        });  
                    }  
 
                </script> 
                <input type="button" value="Post" id="postingButton" onclick="submitbtn()" /> 
            </form> 
 
    <% } %> 
 
    <div> 
        <%=Html.ActionLink("Back to List", "Index") %> 
    </div> 
 
</asp:Content> 
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">  
</asp:Content> 
 
 

Controller
        public ViewResult CreatePost()  
        {  
            return View();  
        }  
        [AcceptVerbs(HttpVerbs.Post)]  
        [Authorize]          
        [ValidateInput(false)]  
        public ActionResult CreatePost([Bind(Exclude = "PostId")]PostModel postToCreate)  
        {  
            Forum forum = null;  
            PostModel parentPost = null;  
 
            if (!string.IsNullOrEmpty(postToCreate.ForumId))  
            {  
                forum = db.GetForums().ByForumId(postToCreate.ForumId).SingleOrDefault();  
                TempData["InformationMessage"] = "You are creating a post in the \"" + forum.Title + "\" forum.";  
            }  
 
            if (postToCreate.ParentPostId.GetValueOrDefault() > 0)  
            {  
                parentPost = Mapper.Map<Post, PostModel>( db.GetPosts().ByParentPostId(postToCreate.ParentPostId.Value).SingleOrDefault());  
 
                // throw a 404 Not Found if the requested parent post is not in the database  
                if (parentPost == null)  
                    throw new HttpException(404, "The post could not be found.");  
 
                //forum = parentPost.f.Forum;  
                TempData["InformationMessage"] = "You are replying to \"" + parentPost.Title + "\" in the \"" + forum.Title + "\" forum.";  
            }  
            // throw a 404 Not Found if the requested forum is not in the database  
            if (forum == null)  
                throw new HttpException(404, "The forum could not be found.");  
 
            if (!String.IsNullOrEmpty(postToCreate.Title) && !String.IsNullOrEmpty(postToCreate.Body))  
            {  
                try  
                {  
                      
                    postToCreate.AddedBy = User.Identity.Name;  
                    postToCreate.AddedDate = DateTime.Now;  
                    postToCreate.AddedByIP = Request.UserHostAddress;                          
                    postToCreatepostToCreate.Title = postToCreate.Title;  
                    postToCreatepostToCreate.Path = postToCreate.Title.ToUrlFormat();  
                    postToCreatepostToCreate.Body = postToCreate.Body;  
                    postToCreate.ViewCount++;  
                    postToCreate.ReplyCount = 0;  
                    //VoteCount = 0,  
                    postToCreate.Approved = !forum.Moderated;  
                    postToCreate.LastPostedBy = User.Identity.Name;  
                    postToCreate.LastPostDate = DateTime.Now;  
                          
                    if (parentPost != null)  
                    {  
                        parentPost.LastPostedBy = User.Identity.Name;  
                        parentPost.LastPostDate = DateTime.Now;  
                        parentPost.ReplyCount++;  
                        Post mappedParent = Mapper.Map<PostModel, Post>(parentPost);  
                        db.UpdatePost(mappedParent);  
                    }  
 
 
                    db.NewPost(Mapper.Map<PostModel, Post>(postToCreate));  
 
 
                    if (forum.Moderated)  
                        TempData["SuccessMessage"] = "Your post has been created and is awaiting approval from a moderator.";  
                    else  
                        TempData["SuccessMessage"] = "Your post has been created.";  
 
                    if (parentPost != null)  
                        return RedirectToAction("ViewPost", new { postId = parentPost.PostId, path = parentPost.Path });  
                    else if (forum.Moderated)  
                        return RedirectToAction("ViewForum", new { forumforumId = forum.ForumId });  
                    else  
                    {  
                        IList<PostModel> posts = Mapper.Map<IList<Post>, IList<PostModel>>(db.GetPosts().ByForumId(postToCreate.ForumId).ToList());  
                        PostModel last = posts.Last();  
                        return RedirectToAction("ViewPost", new { postId = last.PostId, path = postToCreate.Path });  
                    }  
                }  
                catch (Exception exc)  
                {  
                    TempData["ErrorMessage"] = exc.Message;  
                }  
            }  
 
            ViewData["title"] = postToCreate.Title;  
            ViewData["body"] = postToCreate.Body;  
 
            ViewData["PageTitle"] = "Create Post";  
 
            return View("CreatePost");  
        } 

Web.config
<?xml version="1.0"?>  
<!--   
    Note: As an alternative to hand editing this file you can use the   
    web admin tool to configure settings for your application. Use  
    the Website->Asp.Net Configuration option in Visual Studio.  
    A full list of settings and comments can be found in   
    machine.config.comments usually located in   
    \Windows\Microsoft.Net\Framework\v2.x\Config   
--> 
<configuration> 
    <configSections> 
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">  
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">  
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>  
                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">  
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>  
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>  
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>  
                    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>  
                </sectionGroup> 
            </sectionGroup> 
        </sectionGroup> 
 </configSections> 
    <appSettings/> 
    <connectionStrings> 
        <add name="ApplicationServices" connectionString="Data Source=JIMVAIO\SQLEXPRESS;Initial Catalog=PAO17;Integrated Security=True" providerName="System.Data.SqlClient"/>  
    </connectionStrings> 
    <system.web> 
        <!--   
            Set compilation debug="true" to insert debugging   
            symbols into the compiled page. Because this   
            affects performance, set this value to true only   
            during development.  
    --> 
        <compilation debug="true">  
            <assemblies> 
                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>  
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
                <add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
                <add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
                <add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>  
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>  
                <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>  
            </assemblies> 
        </compilation> 
        <!--  
            The <authentication> section enables configuration   
            of the security authentication mode used by   
            ASP.NET to identify an incoming user.   
    --> 
        <authentication mode="Forms">  
            <forms loginUrl="~/Account/LogOn" timeout="2880"/>  
        </authentication> 
        <membership> 
            <providers> 
                <clear/> 
                <add name="AspNetSqlMembershipProvider" 
             type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
             connectionStringName="ApplicationServices" 
             enablePasswordRetrieval="false" 
             enablePasswordReset="true" 
             requiresQuestionAndAnswer="false" 
             requiresUniqueEmail="false" 
             passwordFormat="Hashed" 
             maxInvalidPasswordAttempts="5" 
             minRequiredPasswordLength="6" 
             minRequiredNonalphanumericCharacters="0" 
             passwordAttemptWindow="10" 
             passwordStrengthRegularExpression="" 
             applicationName="/SeventeenthAmendment"/>  
            </providers> 
        </membership> 
 
    <profile defaultProvider="SqlProvider" inherits="PAO17.Data.ViewModels.ProfileCommon">  
      <providers> 
        <clear /> 
        <add name="SqlProvider" 
             type="System.Web.Profile.SqlProfileProvider" 
             connectionStringName="ApplicationServices" /> 
      </providers> 
 
    </profile> 
 
    <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider">  
      <providers> 
        <clear /> 
        <add connectionStringName="ApplicationServices" applicationName="/SeventeenthAmendment" 
         name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
        <add applicationName="/SeventeenthAmendment" name="AspNetWindowsTokenRoleProvider" 
         type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> 
      </providers> 
   </roleManager> 
        <!--  
            The <customErrors> section enables configuration   
            of what to do if/when an unhandled error occurs   
            during the execution of a request. Specifically,   
            it enables developers to configure html error pages   
            to be displayed in place of a error stack trace.  
 
        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">  
            <error statusCode="403" redirect="NoAccess.htm" /> 
            <error statusCode="404" redirect="FileNotFound.htm" /> 
        </customErrors> 
    --> 
        <pages> 
            <controls> 
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
        <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI" /> 
      </controls> 
            <namespaces> 
                <add namespace="System.Web.Mvc"/>  
                <add namespace="System.Web.Mvc.Ajax"/>  
                <add namespace="System.Web.Mvc.Html"/>  
                <add namespace="System.Web.Routing"/>  
                <add namespace="System.Linq"/>  
                <add namespace="System.Collections.Generic"/>  
        <add namespace="Telerik.Web.Mvc.UI" /> 
        <add namespace="PAO17.Services.Models"/>  
        <add namespace="PAO17.Services"/>  
        <add namespace="PAO17.Data.ViewModels"/>  
 
 
      </namespaces> 
        </pages> 
        <httpHandlers> 
            <remove verb="*" path="*.asmx"/>  
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>  
            <add verb="*" path="*.mvc" validate="false" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" /> 
      <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" /> 
      <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" /> 
      <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" /> 
      <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false" /> 
    </httpHandlers> 
        <httpModules> 
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
            <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
        </httpModules> 
    </system.web> 
    <system.codedom> 
        <compilers> 
            <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">  
                <providerOption name="CompilerVersion" value="v3.5"/>  
                <providerOption name="WarnAsError" value="false"/>  
            </compiler> 
            <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">  
                <providerOption name="CompilerVersion" value="v3.5"/>  
                <providerOption name="OptionInfer" value="true"/>  
                <providerOption name="WarnAsError" value="false"/>  
            </compiler> 
        </compilers> 
    </system.codedom> 
 <!--   
        The system.webServer section is required for running ASP.NET AJAX under Internet  
        Information Services 7.0.  It is not necessary for previous version of IIS.  
  --> 
    <system.webServer> 
        <validation validateIntegratedModeConfiguration="false"/>  
        <modules runAllManagedModulesForAllRequests="true">  
            <remove name="ScriptModule"/>  
            <remove name="UrlRoutingModule"/>  
            <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
            <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
        </modules> 
        <handlers> 
            <remove name="WebServiceHandlerFactory-Integrated"/>  
            <remove name="ScriptHandlerFactory"/>  
            <remove name="ScriptHandlerFactoryAppServices"/>  
            <remove name="ScriptResource"/>  
            <remove name="MvcHttpHandler"/>  
            <remove name="UrlRoutingHandler"/>  
 
      <remove name="ChartImage_axd" /> 
      <remove name="Telerik_Web_UI_SpellCheckHandler_axd" /> 
      <remove name="Telerik_Web_UI_DialogHandler_aspx" /> 
      <remove name="Telerik_RadUploadProgressHandler_ashx" /> 
      <remove name="Telerik_Web_UI_WebResource_axd" /> 
        
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> 
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
            <add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>  
            <add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>  
 
      <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode,runtimeVersionv2.0" /> 
      <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0" /> 
      <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0" /> 
      <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0" /> 
      <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode,runtimeVersionv2.0" /> 
 
    </handlers> 
    </system.webServer> 
</configuration> 
 
0
Atanas Korchev
Telerik team
answered on 06 May 2010, 07:35 AM
Hi Jim,

As the error message suggests RadEditor needs a RadScriptManager control. However I don't see one in your ViewPage. If you check the attached example you will see that there is a RadScriptManager control added to the end of the master page. You need one too.

You can check this online example showing how to configure RadEditor tools. Additionally you can refer to RadEditor's online documentation.

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Jim
Top achievements
Rank 1
answered on 07 May 2010, 01:30 AM
Thanks Atanas,
Yes I did see that and added it to my Master page.  When I did I received the error "HttpUnhandledException was unhandled by user code."  It was thrown at the line httpHandler.ProcessRequest(HttpContext.Current);
namespace PAO17.Web  
{  
    public partial class _Default : Page  
    {  
        public void Page_Load(object sender, System.EventArgs e)  
        {  
            // Change the current path so that the Routing handler can correctly interpret  
            // the request, then restore the original path so that the OutputCache module  
            // can correctly process the response (if caching is enabled).  
 
            string originalPath = Request.Path;  
            HttpContext.Current.RewritePath(Request.ApplicationPath, false);  
            IHttpHandler httpHandler = new MvcHttpHandler();  
            httpHandler.ProcessRequest(HttpContext.Current);  
            HttpContext.Current.RewritePath(originalPath, false);  
        }  
    }  
}  
 

Because I have other Telerik MVC extension controls in my site, my Master page also has

<%

Html.Telerik().ScriptRegistrar().Render(); %> also located near the bottom of the page.  Could there be a conflict between radEditor and other controls?

 


Jim 
0
Atanas Korchev
Telerik team
answered on 07 May 2010, 07:04 AM
Hi Jim,

Since this thread was dealing with a different issue I would ask you to open a support ticket and attach a working sample application which shows the problem you are dealing with. Thanks.

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Eugene
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Eugene
Top achievements
Rank 1
Jim
Top achievements
Rank 1
Share this question
or