We have a Document Management System that we use internally and I’m trying to find out if there is a way to save the resulting HTML that is generated when a Controller/Action is called.
I’m needing this so that I can save the string value to a flat file. We then have a script that runs at set intervals and imports the file into the DMS and then deletes it. Does anyone know of anywhere that there is an example of this or have a code sample possibly to get me started?
Also the methods that I’d need to save are currently returning an ActionResult
One option would be to render the resulting action to a string prior to returning the view. There may be a small overhead for this as you technically would be rendering your view twice but you could save the output to the flat file you had mentioned earlier.
For details on how to render a view to a string see: https://stackoverflow.com/a/10746000/501494