HOW TO: Create a Local Web Server ASP.NET Application

Article translations Article translations
Article ID: 321748 - View products that this article applies to.
This article was previously published under Q321748
Expand all | Collapse all

On This Page

SUMMARY

This article describes how to create a local Web Server ASP.NET application.

Create a Local Web Server ASP.NET Application

  1. Start Microsoft Visual Studio .NET.
  2. On the File menu, point to New, and then click Project.
  3. In the New Project dialog box, click Visual Basic Projects under Project Types, and then click ASP.NET Web Application under Templates to create the project in Visual Basic.

    NOTE: Alternatively, you can click Visual C# Project under Project Types, and then click ASP.NET Web Application under Templates to create the project in Visual C#.
  4. In the IIS Web folder (which is typically /wwwroot), create the essential project references and files to use as a starting point for your application:
    • AssemblyInfo (.vb file for Visual Basic or .cs file for Visual C#): Use this file to describe the assembly and to specify version information.
      using System.Reflection;
      using System.Runtime.CompilerServices;
      [assembly: AssemblyTitle("")]
      [assembly: AssemblyDescription("")]
      [assembly: AssemblyConfiguration("")]
      [assembly: AssemblyCompany("")]
      [assembly: AssemblyProduct("")]
      [assembly: AssemblyCopyright("")]
      [assembly: AssemblyTrademark("")]
      [assembly: AssemblyCulture("")]		
      [assembly: AssemblyVersion("1.0.*")]
      [assembly: AssemblyDelaySign(false)]
      [assembly: AssemblyKeyFile("")]
      [assembly: AssemblyKeyName("")]
      						
    • Global.asax: The basic file Global.asax.cs that contains code for responding to application-level events that ASP.NET raises.
      <%@ Application Codebehind="Global.asax.cs" Inherits="WebApplication2.Global" %>
      							
      NOTE: The source of Global.asax.cs is not included in this document.
    • Styles.css: This file contains the default HTML style settings.
    • Web.config: This is an application configuration file that contains settings that are specific to an application. This file contains configuration settings that the common language runtime reads (such as assembly binding policy, remoting objects, and so on), and settings that the application can read.
    • Projectname.vsdisco: This is an XML-based file that the ASP.NET dynamic XML Web service discovery process uses to identify searchable paths on the Web server.
    • WebForm1.aspx: This file contains the portion of the default Web Forms page that contains user interface elements (controls), similar to an HTML page.
      <%@ Page language="c#" Codebehind="WebForm1.aspx.cs" 
      AutoEventWireup="false" Inherits="WebApplication2.WebForm1" %>
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 
      <html>
        <head>
          <title>WebForm1</title>
          <meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
          <meta name="CODE_LANGUAGE" Content="C#">
          <meta name=vs_defaultClientScript content="JavaScript">
          <meta name=vs_targetSchema 
      content="http://schemas.microsoft.com/intellisense/ie5">
        </head>
        <body MS_POSITIONING="GridLayout">
          <form id="Form1" method="post" runat="server">
          </form>
        </body>
      </html>
      						
    • Webform1 (.vb file for Visual Basic or .cs file for Visual C#): This file contains a class file for the default Web Forms page that contains the system-generated and user code for the page.
  5. After you create the project, you see an empty Web Form with that is named "WebForm1.aspx." This is the workspace of the first page in a project, in which you can place WebForms, HTML forms, Components, Data objects, and Clipboard elements from ToolBox.

Create the Project

WARNING: After you create this page, you have to build the application. If you do not, you receive the following error messages:
Server Error in '/WebApplication2' Application
Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'WebApplication2.Global'
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="WebApplication2.Global" %>
Source File: c:\inetpub\wwwroot\WebApplication2\global.asax Line: 1

Browse the Project

After the system works correctly, browsing the page that you created displays the location that you entered in the Creating Project dialog box.

For this example, the following location is displayed:
http://localhost/WebApplication2/WebForm1.aspx

Properties

Article ID: 321748 - Last Review: June 25, 2004 - Revision: 3.5
APPLIES TO
  • Microsoft ASP.NET 1.0
  • Microsoft .NET Framework 1.0
  • Microsoft Windows 2000
  • Microsoft Internet Information Services 5.0
Keywords: 
kbhowto kbhowtomaster KB321748

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com