nitin yadav

nitin yadav

  • NA
  • 136
  • 0

Can we route css and js file in asp.net mvc?

May 15 2018 2:43 AM
Can we route css and js file in asp.net mvc?
 
I want to add some rule in route.config file
 
css file is coming like below from document viewer
 
<link href="/resource.ashx/636598219420000000/du/viewer.css" rel="stylesheet"> 
 
and i want some kind of rule which is like this
routes.MapRoute("/documents/resources/{resource}.ashx/{*pathInfo}", "{resource}.ashx/{*pathInfo}"); 
 
means,  documents/resources/{resource}.ashx/{*pathInfo}" redirect to /resource.ashx/636598219420000000/du/viewer.css

Answers (1)