I am working on doing an aspx page to display code usage examples of a library.
So basically, I'd like to for example have: Description Source Code Button Output (in a datagrid)
Rather than copying and pasting the code from behind the button into the aspx page for display purposes, I was thinking it might be nice to be able to be able to read the actual source code at runtime and display it. Other than being slick, this would have the added benefit of ensuring that the source code displayed is up to date, whereas a copy and paste could get out of date if someone makes a change and forgets to update the aspx page with the new code.
I can think of 2 possible ways to do this: 1) (kludgy) - Deploy the code behind files, which can then be read at runtime and the proper function code can be parsed out and displayed. 2) (Preferred) Run time decompile the DLL (as reflector does) and display the code.
So I know how to do #1, but no idea about #2 (if it is even possible).