简体   繁体   中英

Override 3rd Party Embedded Resource

I'm using the Microsoft.ReportViewer.WebForms control in an MVC3 application. The ReportViewer gets it's javascript by calling an HttpHandler in that same assembly. That handler returns the javascript that is stored as an embedded resource.

My problem is that the javascript that it returns has a bug that causes runtime errors in firefox under certain scenarios.

I'd like to override the embedded resource being returned to use my corrected javascript.

How would I go about doing this? I've looked at resx files, but I don't know how the file should be named, where it would go, etc...

If you know the bug, you could just change the function yourself.

function iHaveBug() { alert('buggy'); }

Then you come in and over write it after it has been loaded:

iHaveBug = function() { alert('all better'); }

You'll need to rebuild the assembly with the corrected javascript file, which is not as hard as it sounds. This post tells you how to do it: http://fortheloveofcode.wordpress.com/2007/09/24/change-resources-inside-assembly/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM