I think you are just trying to protect your code from being visible on the Web Server Or probably from accessing/making modifications after deploying? You probably need to look at Publish options for .NET Web application.
When you publish a web application, there is an option related to pre-compiling of your app. In my attached screenshot, the picture in left highlights the option on Publish setting window - "Precompile during publishing". Now, what it does - The precompiler produces assemblies from the pages. i.e. it generates the assembly (DLL) from your code-behind. At this point, your code is already converted into an assembly. You can ensure the authenticity of your assembly by signing it with a strong name.
Advancing further, you can check the advanced properties and configure your pre-compilation. You can uncheck the checkbox "Allow pre-compiled site to be updatable"(check my attached screenshot). What it does? -
"Compiles the .Aspx Pages, not just the code files (.VB/.CS). Leaving it checked allows you to make certain changes to the .Aspx files after it has been deployed without recompiling (ex = move the position of a control or add some additional HTML markup)."
Hope this helps in case if you didn't know already.