If your IIS (Internet Information Server) cannot interpret an ASPX file and returns an error, there is a big chance that you did not register ASP.Net in IIS.
To do so, just run the commend aspnet_regiis and it handles everything behind the scenes including adding a mime type of ASPX type to IIS so that it will be able to interpret it.