How to prevent ASP.NET 4.0 URL Reroute from breaking jQuery scripts
I've been using the ASP.NET WebForms 4.0 URL Rerouting for some time now and it's been gr开发者_如何学Pythoneat with one exception.
It's been breaking the jQuery scripts I add by breaking the images that are included in the script. Previously I've circumvented this by simply editing the .js files and putting full path to images in there but now I am trying to add the Wymeditor and it's not that simple anymore.
I am trying to define a rule in Global.asax that would disable routing for all my .js files in a specified folder. My wymeditor is in scripts/wymeditor. The forms resides in someaddress/blog/new-post which routes to AddNewPost.aspx. I tried doing
routes.Ignore("{*alljs}", new {alljs=@".*\.js(/.*)?"});
But it doesn't seem to work.
I don't know about the editor or reroute, but you may use paths relative to the server root like, instead of "Folder/AnotherFolder/Myfile.js" you can use "/Folder/AnotherFolder/Myfile.js", it avoids the confusion in most scenarios, maybe it will save you too.
精彩评论