To enable ASP.NET in Windows 7 and Windows Server 2008
In Windows 7, you can enable ASP.NET from Control Panel -> Programs -> Programs and Features -> Turn Windows features on or off. Expand Internet Information Services -> World Wide Web Services -> Application Development Features and click ASP.NET.
In Windows Server 2008, Open Server Manager -> click Roles -> click Add Roles -> select Web Server (IIS) -> in Role Services click ASP.NET it will prompt for necessary dependent Roles Services click Add Required Role Services.