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

Using themed css files requires a header control on the page.

3 Answers 198 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Swapnil Prakash
Top achievements
Rank 1
Swapnil Prakash asked on 21 Jun 2012, 08:54 AM
Hi there,
I am using telerik RadEditor like this in asp.net web application.
ASPX
<telerik:RadEditor ID="message" runat="server">                      
</telerik:RadEditor>
ASPX.CS
Had set Image Paths from server side.
string[] imagepath = { "../Images" };
message.ImageManager.ViewPaths = imagepath;
message.ImageManager.UploadPaths = imagepath;
message.ImageManager.DeletePaths = imagepath;
message.ImageManager.EnableImageEditor = false;

WEB.CONFIG
<add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2010.2.713.20, Culture=neutral, PublicKeyToken=########" verb="*" validate="false"/>
<add verb="*" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=########"></add>
<add verb="*" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler, Telerik.Web.UI, Culture=neutral, PublicKeyToken=########"></add>

TELERIK  ASSEMBLY VERSION : Version=2010.2.713.20

Giving me exception as Using themed css files requires a header control on the page. (e.g. <head runat="server" />). when clicked on Image Manager on editor. With web.config error message as

Web.config registration missing!
 The Telerik dialogs require a HttpHandler registration in the web.config file. Please, use the control's Smart Tag to add the handler automatically, or see the help for more information: Controls > RadEditor > Dialogs > Introduction


Kindly help me to resolve the issue.

Regards,
Swapnil

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 25 Jun 2012, 02:39 PM
Hi,

For your convenience, I pasted below the solution that one of our customers proposed for the reported error:

We are compiling our .net web site project to a dll. When we compile the web site, it writes the current theme to each page's head for some reason. To override this I had to write a piece of code on Application_PreRequestHandlerExecute which gets the current page and sets the theme we specified in web.config. Everything works just fine, but when I added the rad spell, which opens a dialog I get the following error:

Error: Web.config registration missing! The Telerik dialogs require a HttpHandler registration in the web.config file.


After looking into it a bit more underlying error which causes that is:
Using themed css files requires a header control on the page. (e.g. <head runat="server" />).


I don't have the full source code version of radcontrols for .net, so I can't change the handler's head to have the runat="server". I solved the problem by adding a check where I set the theme to check that if the page is a dialog handler or any other telerik handler, I won't force the theme. Of course if you would add that runat to the head, then everything would be solved.


Example code:
protected void Application_PreRequestHandlerExecute(object sender, System.EventArgs e)
     {
         Page page = HttpContext.Current.Handler as Page;
         if (page != null)
         {
             //This override routine has to be done because at compile the style is
            //  written to the page's head on web sites for some reason
             //Telerik dialog handler doesn't have head runat="true", which would cause errors when setting the theme
             if (!(page is Telerik.Web.UI.DialogHandler) &&
                 !(page is Telerik.Web.UI.SpellCheckHandler) &&
                 !(page is Telerik.Web.UI.RadUploadProgressHandler) &&
                 !(page is Telerik.Web.UI.SpellCheckHandler))
             {
                 page.Theme = "Theme1";
             }
         }
     }

Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Swapnil Prakash
Top achievements
Rank 1
answered on 26 Jun 2012, 06:13 AM
Hi Rumen,
Thanks for the reply.
I tried above code in Global.asax file still it doesn't solve my problem.
Its still giving me the same error "Using themed css files requires a header control on the page. (e.g. <head runat="server" />). ".
Regards,
Swapnil
0
Rumen
Telerik team
answered on 28 Jun 2012, 01:33 PM
Hello Swapnil,

In such case, please open a support ticket and attach a simple working project that demonstrates the problem. I will examine it and try to provide a solution.

Best regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Editor
Asked by
Swapnil Prakash
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Swapnil Prakash
Top achievements
Rank 1
Share this question
or