Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to defer parsing of WebResource.axd and ScriptResource.axd files. Is it possible? If it is possible, please let me know the solution.

Can I use some handler to write these scripts to external file and load it later on the onload event.
Posted
Updated 19-Aug-19 23:04pm

XML
Download the ScriptCompressor.cs file below and put it in your App_Code folder. Then add the following lines to your web.config:

<httpModules>
  <add type="ScriptCompressorModule" name="ScriptCompressorModule" />
</httpModules>
<httpHandlers>
  <add verb="*" path="*js.axd" type="ScriptCompressorHandler" />
</httpHandlers>

Download
ScriptCompressor.zip (3.43 kb)
 
Share this answer
 
Comments
Member 12224557 30-Aug-16 1:47am    
I use the same code inside system.web tag its giving me 500 error
Download the ScriptCompressor.cs file below and put it in your App_Code folder. Then add the following lines to your web.config:

<httpModules>
  <add type="ScriptCompressorModule" name="ScriptCompressorModule" />
</httpModules>
<httpHandlers>
  <add verb="*" path="*js.axd" type="ScriptCompressorHandler" />
</httpHandlers>

Download
ScriptCompressor.zip (3.43 kb)


download link not available.
 
Share this answer
 
Comments
CHill60 20-Aug-19 9:05am    
If you want to comment on a post use the "Have a Question or Comment?" link next to it. Or you could always just try searching for it using a Search Engine like Google.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900