Dialogs broken for RadEditor after upgrade

2 Answers 130 Views
UI for ASP.NET AJAX in ASP.NET MVC
Kai
Top achievements
Rank 1
Kai asked on 27 Apr 2023, 06:07 AM

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.

Rumen
Telerik team
commented on 27 Apr 2023, 08:22 AM

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:

fuquan
Top achievements
Rank 1
Iron
commented on 21 Jun 2023, 05:30 AM

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>
But the module dialog is still broken , I get below error in edge console :

About Enable the RadStyleSheetManager CDN, didn't work for me because I can't access the link below.

2 Answers, 1 is accepted

Sort by
0
fuquan
Top achievements
Rank 1
Iron
answered on 26 Jun 2023, 01:28 AM

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 :

 

Rumen
Telerik team
commented on 26 Jun 2023, 01:25 PM

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.

 

fuquan
Top achievements
Rank 1
Iron
commented on 27 Jun 2023, 01:43 AM

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&amp;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>

 

Rumen
Telerik team
commented on 27 Jun 2023, 05:44 AM

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:

If you are unable to resolve the issue as a last resort you can replace the LinkManager with the InsertLink dialog.




0
fuquan
Top achievements
Rank 1
Iron
answered on 29 Jun 2023, 07:07 AM

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:

Rumen
Telerik team
commented on 29 Jun 2023, 01:43 PM

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.

fuquan
Top achievements
Rank 1
Iron
commented on 30 Jun 2023, 02:00 AM

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?

fuquan
Top achievements
Rank 1
Iron
commented on 30 Jun 2023, 04:27 AM

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 !

Rumen
Telerik team
commented on 30 Jun 2023, 07:34 AM

Grert news! I am glad that you've managed to resolve the problem! Can you shed more light on the CSS file contents you deleted? Was it something specific in the CSS content that was causing the problem or it can be repro with any CSS class, selector or setting, e.g. does it happen with a standard body { color: red; } class? 
fuquan
Top achievements
Rank 1
Iron
commented on 04 Jul 2023, 06:48 AM

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 .

Rumen
Telerik team
commented on 04 Jul 2023, 07:17 AM

I see, thank you for the details! If you by any chance find out in the future which CSS is causing the trouble, please let us know.
Tags
UI for ASP.NET AJAX in ASP.NET MVC
Asked by
Kai
Top achievements
Rank 1
Answers by
fuquan
Top achievements
Rank 1
Iron
Share this question
or