New Document
ASP.NET Environment Setup

ASP.Net provides an abstraction layer on top of HTTP on which the web applications are built. It provides high-level entities like classes and components within an object-oriented paradigm.

The key development tool for building ASP.Net applications and front ends is Visual Studio. In these tutorials, we will work on Visual Studio 2008.

Sub program that can take data called parameters (optional), execute a computation (task) and return a value.

Function is a reusable piece of code. By reusable we mean that you need to make only once but you can use it many times. for example, a function of addition on a calculator. the keywords for making a function are function, return, end function. as functions, sub routines and classes are the part of VB.net, thats why we will use a separat block for it, instead of using asp block.

Preface

The aim of this article is to give developers a complete set of steps that will allow them to setup their own isolated development environment for developing websites with ASP.NET, Subversion, and Windows XP.

Microsoft recommends developing ASP.NET web applications in an isolated development environment. For more information on the various kinds of development environments, read the chapter ASP.NET Web Application Development Models from the article Team Development with Visual Studio .NET and Visual SourceSafe.

For developers that already have their environment setup but are not using source control, this article provides simple steps on how to add this functionality to their setup. At the end of each section I have included an Errors section which lists common errors that can occur when performing the proceeding tasks.

The benefits of having a properly setup development environment come in many forms, and once you've used source control and seen how easy it is to setup, you'll wonder how you ever developed without it.

Some of the benefits of source control include:


Easily scale the number of people working on a project


Allow secure and efficient external access to projects for contractors and road warriors

More robust file and project disaster recovery, no need to worry about "where did that file go?"

Monitoring the quality of code being written, no more "who wrote this" questions need to be asked

Easier workflow automation to reduce errors moving code between development, staging, and production.


The article covers topics such as:


How do I setup my machine to be a local/isolated ASP.NET development environment?

How do I setup source control for internal and external network access?

How do I publish my website from a Subversion repository to my development server?

How do I setup my ASP.NET project to have environment specific settings?


The new project window allows choosing an application template from the available templates.

When you start a new web site, ASP.NET provides the starting folders and files for the site, including two files for the first web form of the site.

The file named Default.aspx contains the HTML and asp code that defines the form, and the file named Default.aspx.cs (for C# coding) or the file named Default.aspx.vb (for vb coding) contains the code in the language you have chosen and this code is responsible for the form's works.

The primary window in the Visual Studio IDE is the Web Forms Designer window. Other supporting windows are the Toolbox, the Solution Explorer, and the Properties window. You use the designer to design a web form, to add code to the control on the form so that the form works according to your need, you use the code editor.


Ways to work with views and windows:

The following are the ways to work with different windows:

  • To change the Web Forms Designer from one view to another, click on the Design or source button.

  • To close a window, click on the close button on the upper right corner and to redisplay, select it from the View menu.

  • To hide a window, click on its Auto Hide button; the window changes into a tab, to redisplay again click on the Auto Hide button again.

  • To size a wind just drag it.

Adding folders and files to your web site:

When a new web form is created, Visual Studio automatically generates the starting HTML for the form and displays it in Source view of the web forms designer. The Solution Explorer is used to add any other files, folders or any existing item on the web site.

  • To add a standard folder, right-click on the project or folder under which you are going to add the folder in the Solution Explorer and choose New Folder.

  • To add an ASP.Net folder, right-click on the project in the Solution Explorer and select the folder from the list.

  • To add an existing item to the site, right-click on the project or folder under which you are going to add the item in the Solution Explorer and select from the dialog box.

Projects and Solutions:

A typical ASP.Net application consists of many items: the web content files (.aspx), source files (e.g., the .cs files), assemblies (e.g., the .dll files and .exe files), data source files (e.g., .mdb files), references, icons, user controls and miscellaneous other files and folders. All these files that make up the website are contained in a Solution.

When a new website is created VB2008 automatically creates the solution and displays it in the solution explorer.

Solutions may contain one or more projects. A project contains content files, source files, and other files like data sources and image files. Generally the contents of a project are compiled into an assembly as an executable file (.exe) or a dynamic link library (.dll) file.

Typically a project contains the following content files:

  • Page file (.aspx)

  • User control (.ascx)

  • Web service (.asmx)

  • Master page (.master)

  • Site map (.sitemap)

  • Website configuration file (.config)

Building and Running a Project:

The application is run by selecting either Start or Start Without Debugging from the Debug menu, or by pressing F5 or Ctrl-F5. The program is built i.e. the .exe or the .dll files are generated by selecting a command from the Build menu.



Previous                                                                                                                                                       Next

Back to Top