Create Simple ASP.NET Web App

This tutorial shows how to create a simple “Hello World” web site and deploy to IIS.

  1. Launch Microsoft Visual Studio and create a new project
  2. Select “ASP.NET Empty Web Application”

    Note: You may choose other templates such as Web Forms Application or MVC 3/4 Application.
  3. This will create an empty ASP web application project
  4. Add a new Web Form item and call it default.aspx

    Note: for simplicity, use one of the following names as your main file (see list in IIS > Default Documents for your web site), otherwise you would need to add your custom default file in IIS (which is removed each time you deploy):
  5. Edit file default.aspx and add some simple content
  6. Visual Studio has a built-it web server and allows you to run your web application, locally, directly from Visual Studio
  7. Build your project and run the debugger on your favorite web browser to test your web application

HTTP Requests
If your web application has API for HTTP requests, make sure to add the following code in the web.config file:
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
  <remove name="WebDAVModule"/>
</modules>

This is to avoid the error 405 - HTTP verb used to access this page is not allowed on PUT and DELETE verbs:

For the sake of this tutorial, our web application is considered completed. Following these instructions to publish and deploy the demo web application to IIS.

Source

 

Comments are closed.