Introduction to ASP.NET
What is ASP.NET
What is ASP.NET Microsoft ASP.NET is a free technology that allows programmers to create dynamic web applications. ASP.NET can be used to create anything from small, personal websites through to large, enterprise-class web applications. For more information on ASP.NET, please visit The Official Microsoft ASP.NET Site.
Internet Information Services (IIS) To run ASP.NET 2.0 on your computer you will need the Internet Information Services (IIS) component installed on your machine. IIS 7.0 is included with Windows Vista, Windows Server 2008 and Windows 7. Read Installing IIS 7. IIS 6.0 is included with Windows Server 2003 and is installable via the Add or Remove Programs item in the Control Panel. IIS 5.1 comes with Windows XP Professional and is installable via the Add or Remove Programs item in the Control Panel. IIS 5.0 comes with Windows 2000 Server and is installed by default. It also comes with Windows 2000 Professional and is installable via the Add or Remove Programs item in the Control Panel. Following are the instructions to install IIS component on a Windows XP Professional machine: 1. Place the Windows XP Professional CD-Rom into your Optical Drive. 2. Open Add/Remove Windows Components found in Add/Remove Programs in the Control Panel. 3. Check Internet Information Services (IIS) checkbox and click Next. 4. Once the installation is completed, you can view your homepage by typing "http://localhost/" into the address bar of your browser. 5. The default web directory to place the web site is in 'C:\Inetpub\wwwroot', but you can always set up your own virtual directory through the IIS Manager. For more information, see Creating Virtual Directories in IIS below.
Installation of Microsoft .NET Framework 2.0 or Later ASP.NET Maker scripts required Microsoft .NET Framework 2.0 or later. The Microsoft .NET Framework is a component of the Windows operating system. It provides the foundation for next-generation applications, including ASP.NET web applications. The Microsoft .NET Framework Version 3.5 SP1 can be downloaded from here:
Local IIS Web Sites A local Internet Information Services (IIS) Web site is an IIS Web application on your computer. Creating or opening a local IIS Web site is useful in the following situations:
Requirements
To open an existing local IIS Web site, the preceding must be true as well as the following:
Running Local IIS Web Sites Deploying Local IIS Web Sites
Creating Virtual Directories in IIS 6 In most cases, the content you publish to your Web or FTP site is located in a root or home directory on your computer, such as C:\Inetpub\wwwroot\. However, there might be instances when the content is located somewhere else, or even on a remote computer. To publish from any directory not contained within your home or root directory, you can create a virtual directory. A virtual directory is a directory that is not contained in the home directory but appears to client browsers as though it were. You can create a virtual directory through IIS Manager or by using Windows Explorer.
To create a virtual directory by using IIS Manager
To create a virtual directory by using Windows Explorer
Creating Virtual Directories in IIS 7 The IIS manager user interface consists of three panes. The left hand side pane is Connections, the middle pane is Workspace and the right hand side pane is Actions. The Connections pane lists application pools and websites. The workspace pane consists of two tabs at the bottom namely Features View and Content View. The Features View allows you to work with the settings of the selected item from Connections pane whereas the Content View displays all the child nodes (content) of the selected item. Application pool is a group of IIS applications that are isolated from other application pools. Each application pool runs in its own worker process. Any problem with that process affects the applications residing in it and not the rest of the applications. You can configure application pools individually. In order to create a new application pool, select "Application Pools" under Connections pane. Then click on "Add application pool" from Actions pane. This will open a dialog as shown below: Specify a name for the new pool to be created. Select .NET framework version that all the applications from the pool will use. Also select pipeline mode. There are two pipeline modes viz. integrated and classic. The integrated mode uses the integrated request processing model whereas the classic mode uses the older request processing model. Click OK to create the application pool. Your new application pool will now be displayed in the Workspace pane. To configure the application pool click on the "Advanced Settings" option under Actions pane. The following figure shows many of the configurable properties of an application pool. To create a new web site, select Web Sites node under Connections pane and then click on "Add Web Site" under Actions pane. This opens a dialog as shown below:Here, you can specify properties of the new web site including its application pool and physical location. Creating an IIS application or a Virtual Directory is quick and simple. Just right click on the web site and choose either "Add Application" or "Add Virtual Directory" to open respective dialogs (see below).An existing Virtual directory can be marked as an IIS application by right clicking on it and selecting "Convert to Application". Once you create a website or an IIS application, you can then set several ASP.NET related configuration properties via Workspace pane.
Configuring Permissions An important aspect of working with an Access .mdb file and file upload to a folder on the Web server is to correctly configure permissions. When a Web application uses an Access database, the application must have Read permission to the .mdb file so the application can access the data. Additionally, the application must have Write permission to the folder that contains the .mdb file. Write permission is required because Access creates an additional file that has the extension .ldb in which it maintains information about database locks for concurrent users. The .ldb file is created at run time. By default, ASP.NET Web applications run in the context of a local machine account named ASPNET (for Windows 2000 and Windows XP) or in the context of the account NETWORK SERVICE (for Windows Server 2003 or later). For example, for Windows 2000 or Windows XP Professional, if the Web server is named ABCServer, ASP.NET applications on the ABCServer computer run in the context of the local account ABCServer\ASPNET. Therefore, to use an Access database in an ASP.NET Web application, you must configure the folder that contains the Access database to have both Read and Write permissions for the local ASPNET user account. If you create a Web site in Visual Web Developer, Visual Web Developer creates a folder named App_Data below the current root folder. The folder is designed to be a store for application data, including Access databases. The App_Data folder is also used by ASP.NET to store databases that the system maintains, such as the database for membership and roles. When Visual Web Developer creates the App_Data folder, it grants Read and Write permissions for the folder to the ASPNET or NETWORK SERVICE user account.
ASP.NET Maker also creates the App_Data folder but you may need to set the permissions yourself. To set permissions in the App_Data folder,
Similarly, set permissions in the folder where the uploaded file reside.
Note: If you use hosting, the hosting provider usually will provide a web based control panel for you to set the root of your ASP.NET applications, user permissions, and ASP.NET version. Some hosting provider may create a special anonymous user for your site.
Running Access Database on 64-bit Windows Operating System Windows Server 2008 64-bit (IIS 7) On 64-bit Windows 2008, IIS 7 can run both 32-bit and 64-bit worker processes simultaneously. To run 32-bit Web applications in IIS 7 on 64-bit Windows 2008 all it needs is to assign the 32-bit applications to a separate application pool in IIS and turn on the Enable 32-Bit Applications switch for that application pool. To do this, open IIS Manager, open Application Pool, select the application pool, and then click Advanced Settings. In Enable 32-Bit Applications, select True. Windows Server 2003 64-bit (IIS 6) On 64-bit Windows 2003, although IIS 6 supports running both 64-bit and 32-bit worker processes, it doesn't support running in both modes simultaneously. By default IIS 6 is configured to run in native 64-bit mode and work only with 64-bit worker processes, which means you can only run 64-bit Web applications (for ASP.NET applications they can only target ASP.NET version 2.0 or higher) in the native mode. In order to run 32-bit Web applications you will need to set IIS 6 to run in 32-bit mode. Note: This means all your Web applications will now run in 32-bit mode. To enable IIS 6 to run 32-bit worker processes follow these steps:
The following article explains the details of the changes in the behavior of IIS after configuring it to run 32-bit worker processes: Running 32-bit Applications on 64-bit Windows (IIS 6.0)
|
©2004-2011 e.World Technology Ltd. All rights reserved. |