How do I disable server side code on iis 7.5?

The safest way to do this is by adding the following to your web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <location path="" allowOverride="false">
        <system.webServer>
            <handlers accessPolicy="Read" />
        </system.webServer>
    </location>
</configuration>

It does the same as what William Jens does. However the <location path="" allowOverride="false"> adds a security measure to prevent overrides of the web.config file in subdirectories.

It's worth nothing that you still need to prevent modifications to the root web.config file. For example by making it read only.