Telerik Rich Text Editor and ASP.NET MVC
- Posted by liammclennan on May 28, 2009
- 3 comments
Install the Telerik RAD controls
That name bugs me. They might as well have called it the 'like-cowabunga-narly-rad-fully-awesome-mega-xp-titanium-control-suite'. If, like me, you don't fancy running a 300M installer you can instead download a zip and manually copy the files you need. I recommend this approach since it terns out you only need one file.Add a Reference to Telerik.Web.UI.dll
All that is required is to add a reference from your MVC project to the Telerik.Web.UI.dll. Here is the first place where the telerik documentation let me down. They say to reference the dll in the bin directory but if you are using .NET 3.5 then you need to reference the dll in the bin35 directory.Add some things to Web.config
Read the instructions and add the required handlers to web.config. If you want the editors dialog boxes to work then you must also add a http handler for that. The changes to the web.config are:1.
<
httpHandlers
>
2.
...
3.
<
add
path
=
"Telerik.Web.UI.WebResource.axd"
type
=
"Telerik.Web.UI.WebResource"
verb
=
"*"
validate
=
"false"
/>
4.
<
add
path
=
"Telerik.Web.UI.DialogHandler.axd"
verb
=
"*"
type
=
"Telerik.Web.UI.DialogHandler"
validate
=
"false"
/>
5.
</
httpHandlers
>
1.
<
handlers
>
2.
...
3.
<
add
name
=
"Telerik_Web_UI_WebResource_axd"
verb
=
"*"
preCondition
=
"integratedMode"
path
=
"Telerik.Web.UI.WebResource.axd"
type
=
"Telerik.Web.UI.WebResource"
/>
4.
<
add
name
=
"Telerik_Web_UI_DialogHandler_axd"
verb
=
"*"
preCondition
=
"integratedMode"
path
=
"Telerik.Web.UI.DialogHandler.axd"
type
=
"Telerik.Web.UI.DialogHandler"
/>
5.
</
handlers
>
01.
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
02.
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
03.
<
telerik:RadScriptManager
ID
=
"scriptmanager2"
runat
=
"server"
></
telerik:RadScriptManager
>
04.
05.
<%
06.
editor.Content = Model.Content;
07.
%>
08.
<
telerik:RadStyleSheetManager
ID
=
"stylesheetmanager"
runat
=
"server"
></
telerik:RadStyleSheetManager
>
09.
<
telerik:RadEditor
runat
=
"server"
ID
=
"editor"
DialogHandlerUrl
=
"~/Telerik.Web.UI.DialogHandler.axd"
/>
10.
</
div
>
For Reference .....
=========================================================================
No comments:
Post a Comment