Bug reports Found a bug? Post it here please.
Version 5.x > Bug reports > server side Content Editing Error View modes: 
User avatar
Member
Member
MUBASHIR ALI - 5/16/2011 2:39:27 AM
   
server side Content Editing Error
Dear KenticoCMS Team

I have installed the KenticoCMS v5.5.3996 R2 (Free) on my hosting via “Microsoft Web App Gallery”, my problem is that when I want to Edit some content on the server side, when I’m saving it, I’m getting the Following Error.
To resolve this problem I have studied your Thread on these links but I can’t found helpful information to resolve this problem.
http://devnet.kentico.com/Forums.aspx?forumid=52&threadid=14893
http://www.aspcode.net/A-potentially-dangerous-RequestForm-value-was-detected-from-the-client.aspx
http://devnet.kentico.com/Forums.aspx?forumid=46&threadid=16298
But still I’m getting this Error
In my website panel I have added in the website properties in the section of Extension (ASP.NET 4.0)
This is Error.

Server Error in '/' Application.
________________________________________
A potentially dangerous Request.Form value was detected from the client (plc_lt_zoneContent_PagePlaceholder_PagePlaceholder_lt_zoneCenter_MainContentText_htmlValue="<h1>Welcome to the S...").
Description: Request Validation has detected a potentially dangerous client input value, and processing of the request has been aborted. This value may indicate an attempt to compromise the security of your application, such as a cross-site scripting attack. To allow pages to override application request validation settings, set the requestValidationMode attribute in the httpRuntime configuration section to requestValidationMode="2.0". Example: <httpRuntime requestValidationMode="2.0" />. After setting this value, you can then disable request validation by setting validateRequest="false" in the Page directive or in the <pages> configuration section. However, it is strongly recommended that your application explicitly check all inputs in this case. For more information, see http://go.microsoft.com/fwlink/?LinkId=153133.

Exception Details: System.Web.HttpRequestValidationException: A potentially dangerous Request.Form value was detected from the client (plc_lt_zoneContent_PagePlaceholder_PagePlaceholder_lt_zoneCenter_MainContentText_htmlValue="<h1>Welcome to the S...").

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:

[HttpRequestValidationException (0x80004005): A potentially dangerous Request.Form value was detected from the client (plc_lt_zoneContent_PagePlaceholder_PagePlaceholder_lt_zoneCenter_MainContentText_htmlValue="<h1>Welcome to the S...").]
System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection) +8734868
System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, RequestValidationSource requestCollection) +122
System.Web.HttpRequest.get_Form() +114
CMS.GlobalHelper.RequestHelper.IsCallback() +70
CMS.CMSOutputFilter.OutputFilterModule.app_AuthenticateRequest(Object sender, EventArgs e) +18
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

________________________________________
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

If in the Website panel in the section of Extension if I selected here ASP.NET 2.0 Integrated pipeline then it’s working correct, and also If I’m Editing some content on server side, its saved but after some time running my website I’m getting the following Error
Following Error
Server Error in '/' Application.
________________________________________
Execution permission cannot be acquired.
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.Security.Policy.PolicyException: Execution permission cannot be acquired.

Source Error:
The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

<%@ Page Language="C#" Debug="true" %>

or:

2) Add the following section to the configuration file of your application:

<configuration>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Stack Trace:

[PolicyException: Execution permission cannot be acquired.]
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +7606504
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57

[FileLoadException: Could not load file or assembly 'CMS.PortalControls, Version=5.5.3996.30278, Culture=neutral, PublicKeyToken=834b12a258f213f9' or one of its dependencies. Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)]
CMSFunctions.RegisterEvents() +0
CMSFunctions.Init() +26
Global.FirstRequestInitialization(Object sender, EventArgs e) +474
Global.Application_BeginRequest(Object sender, EventArgs e) +27
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

________________________________________
Version Information: Microsoft .NET Framework Version:2.0.50727.4206; ASP.NET Version:2.0.50727.4209


Could you please someone help me to resolving this Error.


User avatar
Kentico Support
Kentico Support
kentico_jurajo - 5/16/2011 6:47:45 AM
   
RE:server side Content Editing Error
Hi,

Which version of .Net framework is set for the application pool where tha app. is running in the IIS?

Could you please confirm that you are using .Net 2.0? I am little bit confused whether you have installed Kentico for .Net 2.0 or 4.0 and what are the actual settings. For the first error, when using .Net 4.0 worked this for other customers:

please add following line into <system.web>...</system.web> section in your web.config file - <pages validateRequest="false">

or

<httpRuntime maxRequestLength="2097151" waitChangeNotification="1" maxWaitChangeNotification="3600" requestValidationMode="2.0"/>


And in the second case it seems that the permissions for the user account, under which is the application pool running are not set correctly.

Best regards,
Juraj Ondrus

User avatar
Member
Member
MUBASHIR ALI - 5/16/2011 11:29:58 AM
   
RE:server side Content Editing Error
Dear Juraj Thanks for Reply

I’m using the Visual Studio 2010 and I have selected the "Target Framework .NET Framework 4" and I think the Default Setting of Visual studio is .NET 4.0


Thanks God, I’m so happy my problem is solved when I added as your instruction requestValidationMode="2.0"/> line on my web.config file

Thanks again.
Mubashir Ali

www.hitrose.com