Visual Studio Support for ASP.NET

Visual Studio 2012 offers a wide range of features to assist you in building applications: IntelliSense, code snippets, integrated debugging, CSS style support, and the ability to target multiple versions of the .NET framework are a few examples. When working with ASP.NET you'll see that many of these productivity features also apply when working with inline code, client-side JavaScript code, XML, and HTML markup.

Web Site and Web Application Projects

Visual Studio gives you two models for ASP.NET projects:

1. Web site projects
2. Web application projects

The Web application project model is very similar to other project types. The structure is based on a project file (.vbproj), and all VB code in the project compiles into a single assembly. To deploy it you copy the assembly along with markup and static content files to the server. You can create a new Web application project by selecting File ⇒ New ⇒ Project from the main menu in Visual Studio.

The Website project model was added with Visual Studio 2005. This model is designed to be very lightweight and familiar to Web developers and designers coming to Visual Studio from other tools. It uses a folder structure to define the contents of a project, enabling you to open a website just by pointing Visual Studio at a folder or a virtual directory. The default deployment model uses dynamic compilation whereby VB source files are deployed along with markup and other content files. Alternately, the project can be precompiled, which creates an assembly per folder or an assembly per page, depending on the settings passed to the compiler. You can create a new website by selecting File ⇒ New ⇒ Web Site from the main menu in Visual Studio.

Web Server Options

ASP.NET gives you three options to host your Web projects:

1. ASP.NET Development Server
2. IIS Express
3. IIS

IIS Express is the default for Web application projects, and the ASP.NET Development Server is the default for Website projects. IIS Express and the ASP.NET Development Server are lightweight and convenient but both only allow you to run and test pages locally.

The mechanism used to select which server will be used depends on the project type. For Website projects, you can choose in the New Web Site dialog by selecting an option from the Web Location drop-down. Selecting File System will use the development server, while selecting HTTP will use IIS.

For Web application projects, you can select which server to use after the project has been created. This is done through the Web tab of the project properties. You can even switch back and forth, enabling you to do most of your development with the IIS Express but switching to IIS when you want to test in an environment closer to production.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset