title: Can I replace a vendor-provided method used by an ASP.NET page?
body: <p>Our internal HR application is developed by the vendor, but I've been given a requirement to change the behaviour of a certain piece of functionality without their assistance (which I don't want to do, but am investigating...).  The functionality in question is an .ashx page which does a number of database lookups, and is called via javascript functions on a web page.  We want to add one further database lookup.</p>
  
  <p>We have control over the javascript code, so that's not a problem, but the code for the .ashx page is held in a compiled assembly.  I've found where it is, and looked into it using .Net Reflector.  Reimplementing the methods involved wouldn't be difficult, if it were technically feasible.</p>
  
  <p>Can I create a new assembly, paste the source taken using Reflector into it, make my modifications, add the DLL to the application, and then set up a new .ashx to refer to it? </p>
  
  <p>The bits I'm worried about not being possible are: </p>
  
  <p>The code refers to some vendor classes held in other assemblies; can I just add references to those assemblies in Visual Studio to allow it to compile, and then when it's compiled and put on the server it'll all work?</p>
  
  <p>Will I have trouble getting the web application to accept the new DLL, given that generally this application is not something we make changes to ourselves?</p>
  
  <p>EDIT: 
  Some clarification: I'm not actually planning to replace the vendor's DLL with one of my own, that does sound like going a bit too far.  Instead, I would make a new DLL with just the one function in it I need (based on stuff taken from the existing DLL using Reflector).  I'd need that code to reference other utility vendor code so that it can get at classes needed to access the framework.  I'd make a brand new .ashx page to serve up the code in the new DLL.</p>
  
  <p>Luckily after all this I'm off the hook, because my customer agrees that things aren't desperate enough for us to attempt all this!  But thanks for the assistance, which is definitely useful.</p>