We upgraded Telerik.Web.UI from version 2012.3.1016.35 to 2023.1.117.45 recently.
The RadEditor renders correctly. But module dialog are all broken. See below screenshot, it's hyperlink manager dialog. (We have two custom dialogs, they are working fine).
Do you know any possible reason of it? I cannot find any log or error message from web browser.
2 Answers, 1 is accepted
Hi Telerik Team,
Could you provide me some solution?
Supplementary explanation :
When I redeploy the website, there is a small probability that the first load will be rendered normally. When I refresh again, there will be a problem that the bullet frame is damaged. I used DevTools to check and found some WebResource.axd 404 Errors.
when I hit refresh :
Hi Fuquan,
The error you get when loading the Telerik CDN url in the browser is expected and does not mean that the CDN will not work properly for your app. Just enable it in the web.config file by adding these two tags in the appSettings section:
<appsettings>
<add key="Telerik.ScriptManager.TelerikCdn" value="Enabled" />
<add key="Telerik.StyleSheetManager.TelerikCdn" value="Enabled" />
</appsettings>
and test the page with RadEditor and its dialog.
The DevTools console shows not only WebResource.axd but also JS errors you should handle to fix the issue. The fact that the dialog loads fine the first time and not the second one most likely means that the app pool is restarted (you may find more details about a server errors in the Windows logs) and the old webresource URLs are cached and do not work anymore. The CDN is pretty handy in such scenarios and my advice is to enable it.
Hi Rumen, Thank you for your reply ,also thanks for your suggestion !
Yeah, now I have added the below key to web.config .
<appsettings>
<add key="Telerik.ScriptManager.TelerikCdn" value="Enabled" />
<add key="Telerik.StyleSheetManager.TelerikCdn" value="Enabled" />
</appsettings>
Now the resource 404 issue is no longer there , but the dialog is still broken. Please find the below screen , currently this broken dialog has undergone some changes , it's width is bigger .
According to your suggestion, I found the relevant log, Could you help to check it ?
Log Name: Application
Source: ASP.NET 4.0.30319.0
Date: 6/27/2023 9:21:13 AM
Event ID: 1309
Task Category: Web Event
Level: Warning
Keywords: Classic
User: N/A
Computer: PRCSHZ011269L
Description:
Event code: 3012
Event message: An error occurred processing a web or script resource request. The resource identifier failed to decrypt.
Event time: 6/27/2023 9:21:13 AM
Event time (UTC): 6/27/2023 1:21:13 AM
Event ID: 534cd34e8a02417eb1ea47052e73eaec
Event sequence: 82
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/3/ROOT/wiki-2-133323023642704266
Trust level: Full
Application Virtual Path: /wiki
Application Path: C:\wiki\
Machine name:
Process information:
Process ID: 9140
Process name: w3wp.exe
Account name: IIS APPPOOL\TN Wiki
Exception information:
Exception type: HttpException
Exception message: Unable to validate data.
at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType, Boolean signData)
at System.Web.UI.Page.DecryptString(String s, Purpose purpose)
at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
Request information:
Request URL: http://localhost/wiki/WebResource.axd?d=AIo013D2FUEWPTI1TGugKsNXhibrig3QH8BoPP7o4wV4jKeqG9PeQjcj3EpRb7IP09wiUdDN-2GGBYlo7Wm-yuB-o1ZIM1Z6pO3UM7cJ4pZHdXBxRNwu27lk0AtjfhE88xfrsShc6DP-XgzCMOTfUi5kEUaYl8UQOXY7kBgWgqhwXCdB0&t=634927255262800178
Request path: /wiki/WebResource.axd
User host address: 127.0.0.1
User:
Is authenticated: True
Authentication Type: Cookies
Thread account name: IIS APPPOOL\TN Wiki
Thread information:
Thread ID: 47
Thread account name: IIS APPPOOL\TN Wiki
Is impersonating: False
Stack trace: at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType, Boolean signData)
at System.Web.UI.Page.DecryptString(String s, Purpose purpose)
at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
Custom event details:
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="ASP.NET 4.0.30319.0" />
<EventID Qualifiers="32768">1309</EventID>
<Version>0</Version>
<Level>3</Level>
<Task>3</Task>
<Opcode>0</Opcode>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2023-06-27T01:21:13.8756659Z" />
<EventRecordID>202371</EventRecordID>
<Correlation />
<Execution ProcessID="9140" ThreadID="0" />
<Channel>Application</Channel>
<Computer></Computer>
<Security />
</System>
<EventData>
<Data>3012</Data>
<Data>An error occurred processing a web or script resource request. The resource identifier failed to decrypt.</Data>
<Data>6/27/2023 9:21:13 AM</Data>
<Data>6/27/2023 1:21:13 AM</Data>
<Data>534cd34e8a02417eb1ea47052e73eaec</Data>
<Data>82</Data>
<Data>1</Data>
<Data>0</Data>
<Data>/LM/W3SVC/3/ROOT/wiki-2-133323023642704266</Data>
<Data>Full</Data>
<Data></Data>
<Data></Data>
<Data></Data>
<Data>
</Data>
<Data>9140</Data>
<Data>w3wp.exe</Data>
<Data>IIS APPPOOL\TN Wiki</Data>
<Data>HttpException</Data>
<Data>Unable to validate data.
at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType, Boolean signData)
at System.Web.UI.Page.DecryptString(String s, Purpose purpose)
at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
</Data>
<Data>http://localhost/wiki/WebResource.axd?d=AIo013D2FUEWPTI1TGugKsNXhibrig3QH8BoPP7o4wV4jKeqG9PeQjcj3EpRb7IP09wiUdDN-2GGBYlo7Wm-yuB-o1ZIM1Z6pO3UM7cJ4pZHdXBxRNwu27lk0AtjfhE88xfrsShc6DP-XgzCMOTfUi5kEUaYl8UQOXY7kBgWgqhwXCdB0&t=634927255262800178</Data>
<Data>/wiki/WebResource.axd</Data>
<Data>127.0.0.1</Data>
<Data></Data>
<Data>True</Data>
<Data>Cookies</Data>
<Data>IIS APPPOOL\TN Wiki</Data>
<Data>47</Data>
<Data>IIS APPPOOL\TN Wiki</Data>
<Data>False</Data>
<Data> at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo, Boolean useLegacyMode, IVType ivType, Boolean signData)
at System.Web.UI.Page.DecryptString(String s, Purpose purpose)
at System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
</Data>
</EventData>
</Event>
You are welcome, Fuquan!
Thank you for sharing the server log! The error message indicates an issue with decrypting a web or script resource request in an ASP.NET application.
It seems that the application encountered an issue decrypting data, possibly related to validation. To solve this error, you can try the following steps:
- Check and try the ideas provided in these resources on the matter:
- StackOverflow - The resource identifier failed to decrypt.
- StackOverflow - IIS(10) error in Event Viewer (The resource identifier failed to decrypt).
- StackOverflow - What does an "Unable to validate data" exception in System.Web.Configuration.MachineKeySection.GetDecodedData indicate.
- Sitefinity article - "Unable to validate data" error message.
- Check the machine key configuration: Verify that the machine key used for encryption and decryption in the application's configuration is correct and consistent across all servers in a web farm or cluster.
- Clear application caches: Clear any temporary or cache files related to the application to ensure that outdated or corrupted data is not causing the decryption issue. See how in our article: Clean Up ASP.NET and Visual Studio Cache and Temp Files.
- Set the mandatory Telerik additions to the web.config file: Configuring Mandatory Additions. Make sure you have set the Telerik.Web.UI.DialogParametersEncryptionKey attribute in the appSettings section of the web.config file.
- If you deploy the project on a WebFarm/WebGarden, you need to change the Telerik.Web.UI.WebResource.axd type. For more information about deploying a solution that uses Telerik controls on a WebFarm or WebGarden, refer to the How to integrate RadControls for ASP.NET AJAX in a WebFarm or WebGarden scenario blog post.
The following example demonstrates how to add the Telerik.Web.UI.WebResource.axd handler type for WebFarm/WebGarden deployment.<system.web> <httpHandlers> <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResourceSession" verb="*" validate="false" /> </httpHandlers> </system.web> <system.webServer> <handlers> <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResourceSession" verb="*" preCondition="integratedMode" /> </handlers> </system.webServer>
Thank you , Rumen !
After a recent analysis, I found out that it's css issue.
Our project uses the local editor.css and editorDialog.css, they are old versions, because we only upgraded the dll when we upgraded Terelck, and the css file was not updated.
I did a lot of testing and organized it into a table for your check. After the test, I have a question, when I set the style path of the dialog to a path that does not exist, the dialog can be rendered normally.But when I comment the following code, the dialog is broken.
//radEditorInstance.DialogsCssFile = ("/themes/TechNet/css/editorDialog.css")
I don't know the logic here, could you help analyze this phenomenon and provide a solution.
Render result(first load) | Render result(non first load) | Local editorDialog.css | Online Editor.css /Editor.Telerik.css | |
comment DialogsCssFile code and use CDN | success | fail | Not loaded | load once |
comment DialogsCssFile code and don't use CDN | success | fail | Not loaded | Not loaded |
Don't comment DialogsCssFile code and use CDN | fail | fail | load once | load once |
Don't comment DialogsCssFile code and don't use CDN | fail | fail | load once | Not loaded |
Assign a non-existent path to DialogsCssFile and use CDN | success | success | Request 404 | loaded |
Assign a non-existent path to DialogsCssFile and don't use CDN | success | success | Request 404 | Not loaded |
screenshost:
Assign a non-existent path to DialogsCssFile:
The RadEditor file browser and link manager dialogs use lazy loading so the stylesheet is loaded once and cached. I think that this is the reason why when the DialogsCssFile is set, its CSS file is loaded once.
Can you remove the querystring part after the CSS file, e.g. ?V= + BuildVersionHelped and see if the behavior will change since the different querystring value forces the browser to read and not cache the css/js scripts.
I also noticed the missing ~ tilde symbol before ~/theme folder for the DialogCssFile value. You should add it as it is already done for the CssFiles property. This way you will ensure that the path will be correctly resolved.
Yeah, I tryed remove the querystring part after the CSS file, but nothing works .
Do not add ~ tilde symbol to make this css request return 404 ,In this way, the dialog box can be rendered normally . Why my commenting this code has no effect?
Now I have solved this problem, first I cleared the content of this css, I added a timestamp after this css request, let it go to request every time without using cache. This can achieve the same effect as 404.
Thank you for your help !
sorry for my late reply !
I cleared all the contents of the editorDialogs.css file, and let the website request this empty css file every time.
As for what makes it broken, I haven't studied it carefully. That's a piece of css code from a long time ago.
My inspiration comes from the part circled in red in the screenshot below,here is a test I did with six different scenarios .
Hi Kai,
Can you see for any JS errors in the devtools console as well as for blocked web resources?
You can also try the following suggestions:
https://docs.telerik.com/devtools/aspnet-ajax/knowledge-base/common-capture-issues-with-fiddler-jam
Also, please share the aspx, ascx, CSS, master page files as well as their code-behind files so we can review what could lead to this issue.
Hi All ,
Now renderMode is Lightweight and WebResource.axd has registered in web.config .
<httpHandlers> <add path="Telerik.Web.UI.DialogHandler.axd" verb="*" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI" validate="false" /> <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false" /> </httpHandlers> ... <handlers> <add name="Telerik.Web.UI.DialogHandler.axd" path="Telerik.Web.UI.DialogHandler.axd" verb="*" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI" preCondition="integratedMode" /> <add name="Telerik.Web.UI.WebResource.axd" path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" preCondition="integratedMode" /> </handlers>
About Enable the RadStyleSheetManager CDN, didn't work for me because I can't access the link below.