There are many ways to set the target .net framework. Few are listed below.
When we add a project , we can set the target .net framework. Refer the screenshot.
We can change the framework by making changes in project->properties also.
In latest version, framework can also be set by changing web.config.