aspx pages not getting served on IIS 7

i) Symptoms: HTTP Error 500.21 - Internal Server Error
Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

Resolution: Add global modules section in applicationHost.config

<add name="ManagedEngine" image="%windir%\Microsoft.NET\Framework\v2.0.50727\webengine.dll"
preCondition="integratedMode,runtimeVersionv2.0,bitness32" />

for 64 bit
<add name="ManagedEngine64" image="%windir%\Microsoft.NET\Framework64\v2.0.50727\webengine.dll"
preCondition="integratedMode,runtimeVersionv2.0,bitness64" />

ii)Symptoms: HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.

Resolution: Add handlers section now. aspx extension should be properly mapped to PageHandlerFactory-Integrated handler
<add name="PageHandlerFactory-Integrated" path="*.aspx" verb="GET,HEAD,POST,DEBUG"
type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode" />