Editor sometimes buggy
I have noticed in my development server testing 5.0sp1 that the editor is sometimes non-responsive. It seems that when editing a page sometimes the "Edit" and "More" verbiage usually found on widgets is not there and the "Back to Pages" link does not function. Seems as if a JavaScript error is happening.
I have tried in FF12 and IE 8 & 9 with the same results.
The screenshot highlights the issues.
Typically a refresh and everything works normally. This only happens about every 5-8 edits.
Has anyone else seen this?
I have noticed that when this happens, one of the support files shows as a page not found.
/departments/academics/Action/b588729e-b2cf-4d78-829c-0a7acce3a3fb is one that is happening right now.
Page not found
Description: An unhandled exception occurred during
the execution of the current web request. Please review the stack trace
for more information about the error and where it originated in the
code.
Exception Details: System.Web.HttpException: Page not found
Source Error:
An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.
Stack Trace:
[HttpException (0x80004005): Page not found]
Telerik.Sitefinity.Web.PageRouteHandler.handler_PreRenderComplete(Object sender, EventArgs e) +1132
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4543
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
Any possible reason this could be happening?
Anthony
Hi, Anthony.
Thank you for contacting us.
Yes, a javascript exception would break the scripts in our page editor meaning it will become unresponsive - you cannot edit/publish/click on anything - this is expected.
Based on your description I am not able to determine the exact cause of the error.
Are you using any custom javascript or custom widgets or modules?
If you use a debugger (FireBug, etc) can you check to see if everything loads and if not what?
Is this a live site? Can you give me temporary credentials to your backend so I can inspect it?
Regards,
Randy Hodge
the Telerik team
I am using the bytanium image rotator and some JavaScript for the menu at the top of our page. Both of these have been in the site since it was developed in 4.0 with no problems.
This in only on the development server currently and only available internally. We are doing testing this week before pushing it out to the public on Thursday evening. The development server is not using a fully qualified domain name, and that may cause some problems with JavaScript depending on how they are written.
In Firebug everything loads except for two support files, one of which is show in the post below. I have noticed that these do not load anytime, regardless of the editor being available or not.
I have not had this problem occur without being able to refresh and everything load normally. The JavaScript errors disappear after a refresh as well.
Thanks.
Anthony
After further testing this is what I know.
1. On a new fresh, blank install this does not happen.
2. If I create a new blank template from scratch in the development site this does not happen.
3. If I create a new blank template from scratch and apply my them this does not happen
4. If I create a blank template based on my .master file, this happens.
5. If I use any template based on my main template based on the .master file, this happens.
6. If I use any of my templates based on the master, and strip all menus and content from them and then add one content block, this still happens.
So it seems to me that the problem lies somewhere in my main .master file, and every one of my templates is based on this file.
The contents of the master file are below:
layout02.master
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Layout02.master.cs" Inherits="App_Master_MasterPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
>Untitled Page</
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"ScriptManager"
></
telerik:RadScriptManager
>
<
div
id
=
"doc2"
class
=
"yui-t2"
>
<
div
id
=
"hd"
>
<!-- PUT MASTHEAD CODE HERE -->
<
asp:ContentPlaceHolder
ID
=
"Top"
runat
=
"server"
>
</
asp:ContentPlaceHolder
>
</
div
>
<
div
id
=
"menu"
>
<!-- PUT MENU CODE HERE -->
<
asp:ContentPlaceHolder
ID
=
"TopMenu"
runat
=
"server"
>
</
asp:ContentPlaceHolder
>
</
div
>
<
div
class
=
"bd"
>
<!-- CONTENT AND LAYOUT GENERATED BY SITEFINITY WILL GO HERE -->
<
asp:ContentPlaceHolder
ID
=
"MainContent"
runat
=
"server"
>
</
asp:ContentPlaceHolder
>
</
div
>
<
div
id
=
"ft"
>
<!-- PUT FOOTER CODE HERE -->
<
asp:ContentPlaceHolder
ID
=
"Footer"
runat
=
"server"
>
</
asp:ContentPlaceHolder
>
</
div
>
</
div
>
</
form
>
</
body
>
</
html
>
using
System;
using
System.Collections;
using
System.Configuration;
using
System.Data;
using
System.Linq;
using
System.Web;
using
System.Web.Security;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Web.UI.WebControls.WebParts;
using
System.Web.UI.HtmlControls;
using
System.Xml.Linq;
public
partial
class
App_Master_MasterPage : System.Web.UI.MasterPage
protected
void
Page_Load(
object
sender, EventArgs e)
Removing the:
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"ScriptManager"
></
telerik:RadScriptManager
>
Hello, Anthony.
When a page is viewed in the backend, Sitefinity automatically adds a ScriptManager (for the extra controls used for editing) so if you have one in your master page you'll get two. This causes problems as you have seen. Checking the "Include RadScriptManager" box will include the ScriptManager only on the frontend for that page.
So, yes, you should remove it from your master page and check the box on all your pages.
But you don't need to do each one manually. You can use the API to do it. Something like this:
PageManager pageMgr = PageManager.GetManager();
var pageList = pageMgr.GetPageDataList().ToList().Where(p => p.IsBackendPage ==
false
);
foreach
(PageData page
in
pageList)
page.IncludeScriptManager =
true
;
pageMgr.SaveChanges();
Hi Randy,
I figured out a solution for anyone else that comes across this. i added the following line after the pageMgr
declaration.
pageMgr.Provider.SuppressSecurityChecks = true;
Hello, Anthony.
Rick is correct. Add that line of code and your error will not happen. You can also avoid it by being logged in to the site with an account that has the proper permissions before requesting the page with your code.
Please let us know if we can be of further assistance.
Regards,
Randy Hodge
the Telerik team
Can that code be added to the code behind of the master page or does it need to be on its own page as a control?
Also, I am curious as to why this only started being a problem in 5.0? I have had the master page set up as such since the beginning in 4.0 with no issues. The ScriptManager was actually added to the master page after a recommendation from Sitefinity support in case 467564.
Anthony
Hi Anthony,
You only need to run the code once to set all your pages to include a script manager.
Put it on a new webform, load the page and you're done. You can delete the page afterwards if you want.
After that, they will have that property set to true forever unless you go in and turn it off. When you make new pages, make sure you check the box IncludeScritpManager if they will need it.
Regards,
Randy Hodge
the Telerik team