1. Describe the following with respect to .Net: a. Features of .Net Platform The .

NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services. The .NET Framework is designed to fulfill the following objectives: To provide a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely. To provide a code-execution environment that minimizes software deployment and versioning conflicts. To provide a code-execution environment that promotes safe execution of code, including code created by an unknown or semi-trusted third party. To provide a code-execution environment that eliminates the performance problems of scripted or interpreted environments. To make the developer experience consistency across widely varying types of applications, such as Windows-based applications and Web-based applications. To build all communication on industry standards to ensure that code based on the .NET Framework can integrate with any other code. b. Components of .Net Architecture The major components of the .Net framework are shown in the figure below:

At the lowest level, the framework starts with Memory Management and Component Loading and goes all the way up to multiple ways of rendering user and program interfaces. The middle layer provides any system – level capability that a developer needs. The base to the Framework is the Common Language Runtime (CLR). The CLR is the heart of the .Net framework, the engine that drives the key functionality. For example the CLR includes a common system of data types. These common types plus a standard interface convention, make cross language inheritance possible. The CLR also does the reference counting for objects and handles garbage collection. The middle layer consists of standard system services such as ADO.NET AND XML. These services are controlled by the framework making them universally available and standardizing their usage across languages. The top layer has the user and program interfaces. Windows Forms: They provide a new way to create standard Win32 desktop applications, based on the Windows Foundation Classes (WFC) produced for J++. Web Forms: They provide a powerful forms based UI for the web. Web Services: They provide a mechanism for programs to communicate over the Internet using SOAP. They provide an analog of COM and DCOM for object brokering and interfacing, but based on Internet technologies so that allowance is made for integration even with non – Microsoft platforms. The Web Forms and Web Services comprise the Internet interface portion of the .Net, and are implemented through a section of the .Net Framework referred to as ASP.NET. All the above objects are available to any language based on the .Net platform. For completeness, there is also a console interface that allows creation of character – based applications.

c. Assemblies Overview

Assemblies are a fundamental part of programming with the .NET Framework. An assembly performs the following functions: language (MSIL) code in a portable executable (PE) file will not be executed if it does not have an associated assembly manifest. Note that each assembly can have only one entry point (that is, DllMain, WinMain, or Main). quested and granted. resides. A type called MyType loaded in the scope of one assembly is not the same as a type called MyType loaded in the scope of another assembly. that is used for resolving types and satisfying resource requests. It specifies the types and resources that are exposed outside the assembly. The manifest also enumerates other assemblies on which it depends.

language runtime; all types and resources in the same assembly are versioned as a unit. The assembly's manifest describes the version dependencies you specify for any dependent assemblies. For more information about versioning, see Assembly Versioning.

It forms a deployment unit. When an application starts, only the assemblies that the application initially calls must be present. Other assemblies, such as localization resources or assemblies containing utility classes, can be retrieved on demand. This allows applications to be kept simple and thin when first downloaded. For more information about deploying assemblies, see Deploying Applications. -by-side execution is supported. For more information about running multiple versions of an assembly, see Assemblies and Side-by-Side Execution. Assemblies can be static or dynamic. Static assemblies can include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on). Static assemblies are stored on disk in portable executable (PE) files. You can also use the .NET Framework to create dynamic assemblies, which are run directly from memory and are not saved to disk before execution. You can save dynamic assemblies to disk after they have executed. There are several ways to create assemblies. You can use development tools, such as Visual Studio 2005, that you have used in the past to create .dll or .exe files. You can use tools provided in the Windows Software Development Kit (SDK) to create assemblies with modules created in other development environments. You can also use common language runtime APIs, such as Reflection.Emit, to create dynamic assemblies. Benefits of Assemblies Assemblies are designed to simplify application deployment and to solve versioning problems that can occur with component-based applications. End users and developers are familiar with versioning and deployment issues that arise from today's component-based systems. Some end users have experienced the frustration of installing a new application on their computer, only to find that an existing application has suddenly stopped working. Many developers have spent countless hours trying to keep all necessary registry entries consistent in order to activate a COM class. Many deployment problems have been solved by the use of assemblies in the .NET Framework. Because they are self-describing components that have no dependencies on registry entries, assemblies enable zero-impact application installation. They also simplify uninstalling and replicating applications.

This can be modified via the LoadViewState( ) method: This allows ASP. It is essentially your last chance to modify the output prior to rendering using the OnPreRender( ) method. You can override this using the SaveViewState() method. the goal is to render appropriate HTML output back to the requesting browser. You can override it using the Render method. State is restored. Save State: Near the beginning of the life cycle. . The life cycle begins with a request for the page. the data sent to the server in the posting is processed.NET server: Initialize: Initialize is the first phase in the life cycle for any page or control. to create and initialize server controls in the control tree. It gives you an opportunity to do any final cleanup and release references to any expensive resources.2. the persisted view state was loaded from the hidden variable. It is here that any settings needed for the duration of the incoming request are initialized. CreateChildControls( ) is called. These events. change events are raised via the RaisePostDataChangedEvent( ) method. When the request is complete. b. persisting as a string object that will complete the round trip to the client. to create and initialize server controls in the control tree. and the form controls show client-side data. such as database connections. Process Postback Data: During this phase. select ASP. If any of this data results in a requirement to update the ViewState. Now it is saved back to the hidden variable. constitute the life cycle of the page and all its components. and type in its name. Send Postback Change Modifications: If there are any state changes between the current state and the previous state.NET and open a New Project named ProgrammingCSharpWeb.NET Web Application as the project type. from beginning to end. Select the Visual C# Projects folder (because C# is your language of choice).NET to manage the state of your control across page loads so that each control is not reset to its default state each time the page is posted. Creating a Web Form Write programs with corresponding output screens to demonstrate the above concepts. used to persist the state across round trips to the server. The life cycle of a page is marked by the following events. You can modify it using the Dispose( ) method. Handle Postback Events: The client-side event that caused the postback is handled. To create the simple Web Form that will be used in the next example. The input string from this hidden variable is parsed by the page framework. Describe the following with respect to creating Web Forms in . The ViewState information comes from a hidden variable on the control. each of which you can handle yourself or leave to default handling by the ASP. PreRender: This is the phase just before the output is rendered to the browser. start up Visual Studio . if necessary.Net environment: a. that update is performed via the LoadPostData( ) method. the page is unloaded. and the ViewState property is set. Web Form Life Cycle Every request for a page made from a web server causes a chain of events at the server. which causes the server to load it. You can modify the load phase by handling the Load event with the OnLoad method. Load ViewState: The ViewState property of the control is populated. Dispose: This is the last phase of the life cycle. Render: This is where the output to be sent back to the client browser is generated. Load: CreateChildControls( ) is called. if necessary. From one end of the life cycle to the other.

WebForm1. To do this.NET will generate a bit of boilerplate code to get you started. close WebForm1.cs.aspx. Visual Studio . WebForm1. and then right-click its name in the Solution Explorer.aspx.When you create a new Web Form application.aspx. you must place the cursor within Visual Studio . Design mode lets you drag controls onto your form.cs.aspx to HelloWeb.NET. Start by renaming WebForm1. When viewing the form.aspx.NET will display http://localhost/ as the default location. Choose Rename and enter the name HelloWeb. open HelloWeb. The solution files and other Visual Studio-specific files are stored in <drive>\Documents and Settings\<user name>\My Documents\Visual Studio Projects (where <drive>andappear in the Solution Explorer. right-click the form. WebForm1.ProgrammingCSharpWeb. c:\Inetpub\wwwroot\ProgrammingCSharpWeb. After you rename it. You can now tab back and forth between the form itself.cs) file.aspx. you can choose between Design mode and HTML mode by clicking the tabs at the bottom of the Editor window. Let's take a closer look at the .aspx and code-behind files that Visual Studio creates.aspx. HTML mode allows you to view and edit the HTML code directly.aspx and view the code.cs" . and choose "View Code" in the pop-up menu. To see the code behind (. as shown in Figure Creating a project in the New Project window of Visual Studio .aspx. and the C# code-behind file. as shown in Example below: <%@ Page language="c#" Codebehind="HelloWeb. you will find that the code-behind file has been renamed as well to HelloWeb.NET Visual Studio places nearly all the files it creates for the project in a folder within your local machine's default web site – for example. Visual Studio .aspx.

you can add script and HTML directly to the file just as you could with classic ASP. Adding the following line to the body segment of the HTML page will cause it to display a greeting and the current local time: Hello World! It is now <% = DateTime.cs.UI.WebForm1" %> The language attribute indicates that the language used on the code-behind page is C#. You could just as easily write the line as: Hello World! It is now . methods. Any tag that includes this attribute is considered a server-side control to be executed by the ASP.Page.microsoft.Web. Returning to the HTML view of HelloWeb. Having created an empty Web Form.NET code: <%@ Page language="c#" Codebehind="HelloWeb. which contains the following ASP. you see that a form has been specified in the body of the page using the standard HTML form tag: <form id="Form1" method="post" runat="server"> Web Forms assumes that you need at least one form to manage the user interaction.com/intellisense/ie5"> </head> <body MS_POSITIONING="GridLayout"> <form id="Form1" method="post" runat="server"> </form> </body> </html> What you see is typical boilerplate HTML except for the first line.Page As the C# code makes clear. indicating that code falls between them (in this case.cs. just like a call to Response.WebForm1" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4. the first thing you might want to do is add some text to the page. WebForm1 is a class declared in HelloWeb. The Codebehind attribute designates that the filename of that page is HelloWeb. C#).AutoEventWireup="false" Inherits="ProgrammingCSharpWeb.NET to display the value. public class WebForm1 : System.aspx. and events common to all server-side pages.NET framework on the server.UI.ToString( ) %> The <% and %> marks work just as they did in classic ASP.0"> <meta name="CODE_LANGUAGE" Content="C#"> <meta name="vs_defaultClientScript" content="JavaScript"> <meta name="vs_targetSchema" content="http://schemas.Now.cs" AutoEventWireup="false" Inherits="ProgrammingCSharpWeb.0 Transitional//EN" > <html> <head> <title>WebForm1</title> <meta name="GENERATOR" Content="Microsoft Visual Studio 7. and the Inherits attribute indicates that this page derives from WebForm1. which is the class that defines the properties. The = sign immediately following the opening tag causes ASP. The attribute runat="server" is the key to the serverside magic. WebForm1 inherits from System.Write( ).Web.aspx. By switching to HTML view. and creates one when you open a project.

Session state is similar to application state. Instead. b. The cookies are saved on the client device. You can use session state to accomplish the following tasks: ntify browser or client-device requests and map them to an individual session instance on the server.NET allows you to save values by using session state — which is an instance of the HttpSessionState class — for each active Web-application session. Cookies in ASP. and then use the token to look up the sensitive information on the server. If different users are using your application. You can use cookies to store information about a particular client. %> Run the page by pressing Ctrl-F5 (or save it and navigate to it in your browser). You should see the string printed to the browser.aspx file 3. and when the browser requests a page. such as a user name or password. as in Figure Output generated by the HelloWorld. Describe the following with respect to State Management in ASP. store a token in the cookie that identifies the user. malicious users have ways to access cookies and read their contents.NET A cookie is a small amount of data that is stored either in a text file on the client file system or in-memory in the client browser session. in a cookie. Cookies can be temporary (with specific expiration times and dates) or persistent.Net: a. The server can read the cookie and extract its value. except that it is scoped to the current browser session. the second user session will have a different session state from the first.ToString( )). Note: The browser can only send the data back to the server that originally created the cookie. session. or application. each user session will have a different session state. However.<% Response. . Session State ASP. Session state is structured as a key/value dictionary for storing session-specific information that needs to be maintained between server round trips and between requests for pages. the client sends the information in the cookie along with the request information. It is recommended that you do not store sensitive information. It contains site-specific information that the server sends to the client along with page output. A typical use is to store a token (perhaps encrypted) indicating that the user has already been authenticated in your application.Now. -specific data on the server for use across multiple browser or client-device requests within the same session. if a user leaves your application and then returns later.Write(DateTime. In addition.

Depending on which options you specify. Once you add your application-specific information to application state.NET (specifically. the Web service’s local URL is http://localhost/calc. Application state is stored in a key/value dictionary that is created during each request to a specific URL. Calc. Describe the following with respect to Web Services in . Once you add your application-specific information to session state.5 also assign descriptive text to their Web methods. you can write application code leveraging these events. application state is useful for storing information that needs to be maintained between server round trips and between requests for pages. Both take two integers as input and return an integer as well. You can add your application-specific information to this structure to store it between page requests. session information can be stored in cookies. In addition. At a minimum.asmx demonstrates several important principles of Web service programming using the . ASMX is a special file name extension registered to ASP. Application State ASP.asmx. the directive must contain a Class attribute identifying the class that makes up the Web service. You can build helper methods into a Web service – methods that are used internally by Web methods but that are not exposed as Web methods themselves – by omitting the attribute. to an ASP. Writing and Testing a Web Service b.‖ . Application state is a global storage mechanism that is accessible from all pages in the Web application. ASMX files begin with @ WebService directives. Implementing a Web Service Client The ASMX file shown in Figure 8. the server manages it.asmx in his or her browser. 4. the server manages this object.NET allows you to save values using application state — which is an instance of the HttpApplicationState class — for each active Web application.Net: a. The WebMethod attributes in Figure 8.asmx in wwwroot. The WebService attribute also supports a Namespace parameter that can be used to change the name of the XML namespace that scopes the Web service’s members. Web methods are declared by tagging public methods in the Web service class with WebMethod attributes.NET Framework: Web services are implemented in ASMX files. on an out-ofprocess server. You’ll learn more about Description and other WebMethod parameters in the section entitled ―The WebMethod Attribute. It implements two Web methods: Add and Subtract. Deploying the Web service is as simple as copying it to a directory on your Web server that is URLaddressable.5 is a complete Web service.on management events.config. The one in this example assigns the Web service a name and a description that show up in the HTML page generated when a user calls up Calc. If you put Calc.NET HTTP handler) in Machine. Web service classes can be attributed with optional WebService attributes. or on a computer running Microsoft SQL Server. c. Thus.

6. What happened? ASP. . The name and description in the ASMX file’s WebService attribute appear at the top of the page. Testing a Web Service How do you test an ASMX Web service? Simple: just call it in your browser. You don’t have to deal with raw XML data or SOAP messages because the . XML.NET.asmx is a full-blown Web service when installed on a Web server outfitted with ASP. The .NET Framework deals with them for you. and HTTP POST. Its Web methods can be invoked with SOAP. All we need now is a way to test it out.asmx to wwwroot and type http://localhost/calc.asmx in your browser’s address bar. You’ll be greeted with the screen shown in Figure 8.HTTP. Calc Web service Despite its brevity. To demonstrate. Underneath is a list of Web methods that the service exposes.NET Framework lends a hand there too.asmx by generating an HTML page that describes the Web service. copy Calc. and it’s capable of returning output in SOAP responses or simple XML wrappers. HTTP GET. and SOAP are hidden under the hood. complete with the descriptions spelled out in the WebMethod attributes. Calc.NET responded to the HTTP request for Calc.

Type 2 and 2 into the ―a‖ and ―b‖ boxes and click Invoke.NET displays a page that you can use to test the Add method (Figure 8.asmx as seen in Internet Explorer Click ―Add‖ near the top of the page. The XML returned by the Web method appears in a separate browser window . and ASP. It even generates an HTML form that you can use to call the Add method with your choice of inputs.Calc.7). ASP.NET knows the method name and signature because it reads them from the metadata in the DLL it compiled from Calc.asmx.

Test page for the Add method .

XML returned by the Add method The forms that ASP.NET Framework simply by pointing your browser to it.asmx That’s the URL of the Microsoft TerraService.exe. Don’t worry about the details just yet. or consume.NET Framework class library (FCL) and a code-generator named Wsdl. type the following URL into your browser’s address bar: http://terraservice. They also let you explore a Web service built with the . Writing Web service clients is even easier.NET generates on the fly from ASMX files enable you to test the Web services that you write without writing special clients to test them with. thanks to some high-level support lent by the . It’s easy to write Web services. Web Service Clients Now that you’ve seen Web services up close and personal. If you have a WSDL contract describing a Web service (or the URL of a DISCO file that . an ultra-cool Web service that provides a programmatic interface to a massive database of geographic data known as the Microsoft TerraServer.net/terraservice. For kicks. But do notice how much you can learn about TerraService simply by viewing the page that ASP. Web methods.NET generated for it. it’s time to learn about Web service clients – that is. applications that use. you’ll be using TerraService to build a Web service client later in this chapter.

the developer creates a Master File that is the template referenced by a subpage or Content Page. but content pages are declared as such within the file’s page directive. The Master Pages are an easy way to provide a template that can be used by any number of ASP. Explain the following with respect to ASP. or navigation bar. and then all pages associated to this Master Page would inherit those common elements.Net: a. Themes & Skins Write code snippets to demonstrate the above concepts. footer. or any combination of these elements. A ContentPlaceHolder can also contain default content. A ContentPlaceHolder defines a region of the master page rendering that can be substituted with content from a page associated to the master. A Master Page is a page that contains markup and controls that should be shared across multiple pages in your site. or code. Master and Content Pages Defining a Master Page is just like defining a normal page. Master Pages b. For example. have directives or server-side code. however. The advantage of defining the header. called a ContentPlaceHolder control. a Master Page can contain a special type of control. A Content Page may only contain markup and controls inside Content controls. A Content control is associated to a particular ContentPlaceHolder control through its ContentPlaceHolderID property. Master Pages – The Master Pages feature provides the ability to define common structure and interface elements for your site. However. footer. to be shared by many pages in your site.SET-2 1.master file extension.NET pages in your application. Write a program in C# language to perform the following operations: a. Basic arithmetic operations b. A Content Page can declare Content controls that specifically override content placeholder sections in the Master Page. such as a page header. Master Pages use a . A page can derive from a Master Page by defining a MasterPageFile attribute on its Page directive. you could define this in a Master Page once. Finding greatest of n numbers Write separate programs for each of the above points. if all of your pages should have the same header and footer banners or the same navigation menu. 2. . instead of multiple times in duplicate code across the pages in your site. Master Pages can contain markup. as demonstrated below. it cannot have any top-level content of its own. and navigation in a Master Page is that these elements need only be defined once.master file extension.aspx file extension you are used to. just in case the derive page does not need to override this content. A page that is associated to a Master Page is called a Content Page. In working with Master Pages. It can. Just as Themes and Skins allow you to factor out style definitions from your page code and maintain them in a common file. This improves the maintainability of your site and avoids unnecessary duplication of code for shared site structure or behavior. The syntax of a ContentPlaceHolder control is given below: <%-- To differentiate a Master Page from a normal page. Master Pages do the same for page layout. whereas content pages use the . a Master Page is saved under the . controls. in a common location called a "master page".

along with some default content for those regions. <%@ Page MasterPageFile="Site. a Master Page is saved under the . have directives or server-side code. The Master Page in this case defines two ContentPlaceHolder regions.master" %> <asp:content id="Content1" contentplaceholderid="FlowerText" runat="server"> With sunshine.jpg" runat="server"/> </asp:content> The following example demonstrates the relationship between Master and Content pages. however. A page that is associated to a Master Page is called a Content Page.ContentPlaceHolder control --%> <asp:contentplaceholder id="FlowerText" runat="server"/> <%-. A Content control is associated to a particular ContentPlaceHolder control through its ContentPlaceHolderID property. as demonstrated below. A Content Page may only contain markup and controls inside Content controls. named FlowerPicture and FlowerText. A page can derive from a Master Page by defining a MasterPageFile attribute on its Page directive. but override the default content for the named ContentPlaceHolder regions with their own content. It can. </asp:content> <asp:content id="Content2" contentplaceholderid="FlowerPicture" runat="server"> <asp:Image id="image1" imageurl="~/images/rose. and careful tending. roses will bloom several times in a season.ContentPlaceHolder with default content --%> <asp:contentplaceholder id="FlowerText" runat="server"> <h3>Welcome to my florist website!</h3> </asp:contentplaceholder> To differentiate a Master Page from a normal page.master" %> A Content Page can declare Content controls that specifically override content placeholder sections in the Master Page. water. it cannot have any top-level content of its own. <%@ Page MasterPageFile="Site. and so it just inherits the default content from the Master Page. Note that the Default. A Sample Web Page The source code for the above web page using C# is given below: .master file extension.<%-.aspx page in this site does not define any Content controls. Individual content pages in the site inherit the common site layout and look-and-feel from the Master Page.

aspx">Rose</a><br/> <a href="dahlia.<%@ master language="C#" %> <html> <head> <link rel="stylesheet" href="StyleSheet.master" %> Rose.aspx">Daffodil</a><br/> <a href="rose.aspx">Hydrangea</a><br/> <a href="daisy.aspx <%@ page language="C#" masterpagefile="~/Site.jpg"/> </asp:contentplaceholder> <br /><br /> <asp:adrotator id="MyAdRotator" advertisementfile="Ads.master" %> <asp:content id="Content1" contentplaceholderid="FlowerText" runat="server"> .css" type="text/css" /> </head> <body> <form id="Form1" runat="server"> <div> <table class="main" cellspacing="0" cellpadding="2"> <tr class="header"> <td colspan="2" class="header"/> </tr> <tr valign="top"> <td class="sidebar" rowspan="2"> <a href="daffodil.xml" runat="server"/> </td> </tr> <tr> <td class="footer"> <asp:label id="Footer" font-italic="true" text="Copyright Microsoft 2003" runat="server" /> </td> </tr> </table> </div> </form> </body> </html> The code for the internal web pages is given below: Default. available for shipping to any location worldwide.aspx <%@ page language="C#" masterpagefile="~/Site.aspx">Dahlia</a><br/> <a href="hydrangea.aspx">Daisy</a><br /> </td> <td class="body"> <asp:contentplaceholder id="FlowerText" runat="server"> <h3>Welcome to my florist website!</h3> We have an enormous selection of quality flowers and seeds. Let us handle all you gardening needs! </asp:contentplaceholder> <br /><br /> <asp:contentplaceholder id="FlowerPicture" runat="server"> <img alt="water lilies" src="Images/waterlilies.

The Master Page has been updated to use server controls in place of HTML: <head runat="server"> <link rel="stylesheet" href="StyleSheet.jpg" /> </asp:content> URL Rebasing in a Master Page One thing to notice about the preceding example is that there are several places in the Master Page that refer to URL resources like images or stylesheet or page references using a relative-path syntax. The Content Pages have been moved to a subdirectory "Pages" under the directory that contains the Master Page.jpg" runat="server"/> Accessing a Master Page from Code In addition to overriding content.gif" runat="server" /> The following example demonstrates this technique. </asp:content> <asp:content id="Content2" contentplaceholderid="FlowerPicture" runat="server"> <img alt="rose" src="images/rose. specifying the virtual path to the master page: <%@ MasterType VirtualPath="Site..aspx" runat="server">Daffodil</a/> . the relative path will not be correct. roses will bloom several times in a season.gif" />  Use relative or application-relative URLs in server controls instead of static markup. A Content Page creates a strongly-typed reference to the Master Page using the <%@ MasterType %> directive. it is possible for a Content Page to programmatically access its Master Page.With sunshine....css" type="text/css" /> </head> . <asp:Image ID="Image1" AlternateText="Water Lillies" ImageUrl="~/Images/Waterlilies. <img alt="water lilies" src="Images/waterlilies. but when the Content Page is in a physically separate location. water. To solve this problem..master" %> The Content Page can then reference the Master Page using the Master property of the Page class: . and careful tending. <a href="daffodil. for example: <head> <link rel="stylesheet" href="StyleSheet.aspx">Daffodil</a> . for example <asp:Image ImageUrl="~/images/banner.jpg"/> This works fine when the Master Page and Content Page are in the same directory....css" type="text/css" /> </head> . <a id="A1" href="pages/daffodil. for example <img src="/myapplication/images/banner. you may take one of the following approaches: te URL paths in the Master Page.

Nesting Master Pages The following is the code for the Home Page of the Nested Pages: <%@ page language="C#" MasterPageFile="~/Site4. dividing the Florist example site into two sections. AdRotator ad = (AdRotator)Master.FooterText = "This is a custom footer" Dim ad As AdRotator = Master. while MyAdRotator is a control on the Master Page. The following example demonstrates this idea.FindControl("MyAdRotator"). Master.C# Code Master. it is possible to derive a Master page from another Master Page. In the code example above. Nesting Master Pages Content Pages can also be Master Pages.master" %> .FindControl("MyAdRotator").FooterText = "This is a custom footer". Annuals and Perrennials. you might have a top-level Master Page that represents the overall site header/footer and navigation of your site. Content Pages would then derive from the appropriate section master for the section the Content Page belongs to. For example. and then separate Master Pages that derive from this Master in order to define different looks for the various sub-sections within your site. FooterText is a public property exposed on the Master Page. That is.

Creating named skins allows you to set different skins for different instances of the same control in an application. without having to edit the individual pages in your site. There are two types of control skins. colors.Themes & Control Skins Creating Themes Themes and Skins: The Themes and Skins feature of ASP. (Default skins are matched exactly by control type. your applications use similar fonts. the style sheet is applied automatically as part of the theme. The following are the uses of ASP. you explicitly apply a named skin to a control by setting the control's SkinID property. Style changes to a site can then be easily maintained by making changes to the Theme.skin files in the Theme folder.NET.org/1999/xhtml> <head runat = “server”> <title>STLNET</title> .skin file can contain one or more control skins for one or more control types. You define a style sheet using the file name extension . For example. and server control styles across all the pages within the application. When you build a web application. page.w3. Themes are the text-based style definitions in ASP. A Control Skin is a default skin if it does not have a SkinID attribute. In general. Named skins do not automatically apply to controls by type. if you create a default skin for a Calendar control. the control skin applies to all Calendar controls on pages that use the theme. it usually has a similar look-and-feel across all its pages. A .) A Named Skin is a control skin with a SkinID property set. collectively called a Theme. When you put a . or server control level. Example: This example demonstrates the application of themes to a sample ASP. Themes can also be shared with other developers.NET allows you to factor style and layout information into a separate group of files.css file in the theme folder. Not too many applications are designed with each page dramatically different from each other. A Theme can then be applied to any site to affect the look and feel of pages and controls within the site. All pages or parts of pages in the application can then access them. You can apply these common styles individually to each and every server control or objects on each page. You can define skins in a separate file for each control or define all the skins for a theme in a single file. but not to LinkButton controls or to controls that derive from the Button object.NET to centrally specify these styles. Cascading Style Sheets A theme can also include a cascading style sheet (.css in the theme folder.NET Themes: pplied at the application. Instead. You create . default skins and named skins: A Default Skin automatically applies to all controls of the same type when a theme is applied to a page. or you can use a capability provided by ASP.css file). so that a Button control skin applies to all Button controls.NET web page: An ASP Page that does not use themes <% Page Language = VB” %> <html xmlns = http://www.

From within the Page directive. but which you can change with one of these new ASP. Applying a Theme to an Entire Application You can apply a Theme to your entire application using the web. Example: Applying a Theme to an Entire Application <?xml Version = “1.config file.NET themes. to change the text box server control that you have been already working with by making its background black and using white text: <asp:Textbox ID = TextBox1” runat = “server” .NET theme that you have either built or downloaded from the Internet: <%@ Page Language = “VB” Theme = “SmokeAndGlass” %> Adding the Them attribute changes the appearance of everything on the page that is defined in an example SmokeAndGlass theme file.web> <pages theme = “SmokeAndGlass”> </ system.NET User Group</h1><br /> <asp:Textbox ID = ―Textbox1‖ runat = ―server‖/> <br /> <br /> <asp:Calendar ID = ―Calendar1‖ runat = ―server‖/> <br /> <asp:Button ID = ―Button1‖ runat = ―server‖ Text = ―Button‖ /> </form> </body> </html> This simple page shows some default server controls. you need not define the theme again in the Page directive of your ASP. If you have multiple pages. make use of the <location/> element to specify the areas of the application for which the theme should be applied. you do not have to think about applying styles to everything you do as you build because the styles are already defined centrally for you.web> </configuration> By specifying the Theme in your web. As an example. In order to apply the theme to only a specific part of an application. Removing Themes from the Server Controls Some times you want an alternative to the theme that has already been defined.</head> <body> <form id = “form1” runat = “server”> <h1> St.config file.0”> <configuration> <system. This theme is applied automatically to each and every page within your application.NET pages. you simply apply an ASP. Louis . You can instantly change the appearance of this page without changing the style of each server control on the page.

if the theming is set to false in the master page and set to true in the content page. use the EnableTheming property of the Textbox Server Control: <asp:Textbox ID = TextBox1” runat = “server” BackColor = “#000000” ForeColor = “#ffffff” EnableTheming = “false” /> To turn off the theming property for multiple controls within a page. To remove the theme that would be applied by the theme setting in the web. which in this case is false. Even if the value is set to false in the master page. Removing Themes from Web pages Suppose that you have set the theme for the entire application using web.config file.skin files are used to define styles for ASP. If this is the case. any value specified in the master page takes precedence.NET page. The Page directive for every ASP. we can still enable theming for specific controls on that page by setting EnableTheming for those specific controls to true and applying a specific theme at the same time as shown in the example given below: <asp:Textbox ID = TextBox1” runat = “server” BackColor = “#000000” ForeColor = “#ffffff” EnableTheming = “true” SkinID = “mySkin”/> Usage of Themes with Master Pages The ASP. Note: The . Creation of User-Defined Themes Users can define their own themes to the pages they would create within an application. That is. These themes created can be applied at the following levels within an application: .config file.NET web page includes an EnableTheming Attribute that can be used to remove theming from your ASP. and you want to exclude a single ASP.BackColor = “#000000” ForeColor = “#ffffff” /> To apply a theme to your ASP.config file for that particular page.NET page but not to the Textbox control. what is specified in the master page naturally takes precedence and no theme is utilized as required by the false setting. you can override this setting at the control level rather than doing it in the Page directive of the content page.NET pages.NET applications that use Master pages have both the Page and Master page directives that contain an EnableTheming attribute. what is the behavior of any content pages using the master page? If the content page that is using this master page does not make any specification on theming (it does not use the EnableTheming attribute). This disables the theming for each and every control within the panel. the page is constructed with the value provided from the master page. Even if you have set the EnableTheming attribute’s value in the content page. you simply construct your corresponding Page directive as follows: <%@ Page Language =”VB” EnableTheming = “False” %> This statement constructs the theme setting to nothing and removes any settings specified in the web. consider using the Panel Control (or any Container Control) to encapsulate a collection of controls and then set the EnableTheming attribute of the Control Panel to false. which could be made possible by removing a theme setting at the page level.NET server controls If the themes are disabled by setting the EnableTheming attribute is set to False at the page level.

The sample code for this file creation is shown below: body { font – size: x-small. Example: Creation of a simple CSS file that changes some of the non-server control items on a ASP. font – family: Verdana. To create your own themes at first. we can make further definitions using Cascading Style Sheets (CSS).css. instead it has a folder icon that includes a paint brush as shown below: Within the existing (or newly created) themes folder. you have to create a proper folder structure in your application. For Example: If you are going to have four themes – Summer. Winter. you define each HTML element that might appear in the ASP.skin file.skin file. In the list of options. It is an easy task to create CSS files for your themes with Visual Studio 2008. For a theme that goes beyond the server controls. we must further define the theme style so that HTML server controls. Step1: Right click the project and add a new folder Step 2: Name the folder appropriately (for example: App_Themes) Step 3: You can also create this folder by right – clicking on your project in Visual Studio and selecting Add ASP. With a .css file should be sitting right next to your Summer. color: #004000. The Summer.NET Folder Theme. HTML. and Spring – then you create four folders that are named appropriately.skin file. } a: link { . Note: When you execute step3 of above. This can be done by including a CSS file within your theme folder.NET page or you make use of class names or element IDs. Example: Right click the Summer theme folder and select Add New Item. the theme folder within the App_Themes folder does not have the typical folder icon next to it.Themes are a way of applying a consistent look and feel across entire application. that can include the following: A single skin file CSS Files Images Adding a CSS to your Themes In addition to the server control definitions that can be created from within a .css file for your theme. Each theme folder must contain the elements of the theme. To create comprehensive theme with this dialog. Fall. select the option Style Sheet and name it Summer. and raw text are all changed in accordance with the theme.NET page. This creates an empty . we could define only the styles associated with server controls and nothing else. we can create an additional theme folder for each and every theme that you can use in your application.

} In this CSS file four things are defined: general. Therefore you can define how your text should appear in the CSS file.NET page. A: visited definition defines the look of the link of a web page already visited by the user previously. and the color of the text. Name the file Summer. } a: visited { color: Blue. A: link definition defines the look of a hyperlink on a web page. plenty of text can appear in a typical ASP. The skin file can have any name. The A: hover definition defines the appearance of the hyperlink when the end user hovers on a hyper-link.skin file <asp:Label runat = “server” Forecolor = “#004000” Font-Names = “Verdana” Font-Size = “XSmall” /> <asp:Textbox runat = “server” Forecolor = “#004000” Font-Names = “Verdana” Font-Size = “XSmall” BorderStyle=”Solid” BorderWidth = “1px” BorderColor = “#004000” Font-Bold = “True” /> <asp:Button runat = “server” Forecolor = “#004000” Font-Names = “Verdana” Font-Size = “XSmall” BorderStyle=”Solid” BorderWidth = “1px” BorderColor = “#004000” Font-Bold = “True” BackColor = “#FFE0C0” /> To use the above listing in a real application. you should actually make a definition for each and every server control option. otherwise your web page may appear quite odd at times.skin. you use a single skin file in the theme folder. Example: Creation of the Summer theme Right – click the Summer folder. The listing for the Summer. In this case. a definition is in place for the size.NET page . The next three definitions in the CSS file revolve around the <a> (anchor tag element used for hyperlinks). } a: hover { color: Red. Using the Summer theme in an ASP. If you specify the runat = “server” attribute in the skinned version of the control. the font family. text-decoration: none. you also include it in the server control you put on an . To create a theme to use in your ASP.aspx page that uses this theme.NET application.skin file extension. and select Skin.skin file is shown below: The Summer. text-decoration: none.NET page that is not placed inside an <asp:Label> or <asp:Literal> tag. text-decoration: underline overline. but it must have a . select Add New Item. Skin Creation: A skin is a definition of styles applied to the server controls in your ASP. Skins can work in conjunction with CSS files or images.color: Blue.

System.EventArgs e) { Label1. } </script> Page with No Theme Applied .Text.Text = ―Hello‖ + TextBox1.ToString().Using C# Language <%@ Page Language = “C#” Theme = “Summer” %> <script runat = “server”> protected void Button1_Click(object sender.

The properties of controls defined in the theme automatically override the local property value for a control of the same type in the target page with the Theme applied. A local value for this . App_Themes Folder Observe in the previous example that the contents of a skin file are simply control definitions as they might appear in a page. For example. a <asp:Calendar Font-Name="Verdana" runat="server"/> control definition in a skin file will cause all Calendar controls in pages with the Theme applied to use the Verdana font. A Theme can also contain a CSS file and/or subdirectories for static files like images. A Theme consists of a named subdirectory under this folder that contains a collection of one or more Skin files.skin extension. A skin file can contain multiple control definitions. for example one definition for each control type. named "Default" and "White". each of which has a single skin file and CSS file.Page with theme applied: The App_Themes Folder Themes reside in the App_Themes folder directly under the application root directory. named with the . The figure below shows an App_Themes directory with two Themes defined.

Global Themes are placed in a "Themes" directory under an ASP. The optional docRef attributes identify the locations of documents describing the Web services. as described above. better known as UDDI.property on the control will be overridden by the Theme. are typically the ASMX files themselves: . it has all the information it needs to make calls to that Web service.NET Framework." %> directive to the name of a global or application-level Theme (the name of a folder under the Themes or App_Themes directory).NET installation directory.asmx To advertise these Web services. how do clients find out where to get a WSDL contract? For that matter. UDDI is discussed in the next section. But when you publish a Web service by making it available on a Web server. which.. Global and Application Themes A Theme can reside at the application-level or machine-level (globally available to all applications). URLs can be absolute or relative (relative to the directory in which the DISCO file resides). A page can only have one Theme applied.NET\Framework\<version>\ASP.. Discovery.wintellect. Clients can interrogate the DISCO file to find out what Web services are available and where the services’ WSDL contracts can be found.NETClientFiles folder under the ASP. but there may be multiple skin files in the theme that apply style settings to controls in the page. because of the selfdocumenting nature of Web services built with the .com/locator. and Integration.NETClientFiles\Themes. you can deploy the following DISCO file at a well-known URL on your server. The latter is a global Web service directory that is itself implemented as a Web service. Note that it is an error to specify an ID property value for a control definition in a skin file. Assigning a Theme to a Page An individual page can be assigned a Theme by setting the <%@ Page Theme=". Web Service Discovery – UDDI Web Service Discovery – DISCO Once a client has a WSDL contract describing a Web service. The contractRef elements identify the URLs of the Web services’ WSDL contracts.asmx http://www. Web Service Discovery – DISCO b. 3.wintellect. The basic idea is that you publish a DISCO file on your Web server that describes the Web services available on it and perhaps on other servers as well. The former is a file-based mechanism for local Web service discovery – that is.com/calc. As an example. The location of global themes is Inetpub\ wwwroot\aspnet_ client\system_web\<version>\Themes for IIS web sites. Application-level Themes are placed in the App_Themes directory under the application root directory. suppose you publish two Web services and their URLs are as follows: http://www. for example %WINDIR%\Microsoft. for getting a list of available Web services from DISCO files deployed on Web servers. The DISCO (short for ―discovery‖) protocol is a simple one that revolves around XML-based DISCO files. how do clients know that your Web service exists in the first place? The answer comes in two parts: DISCO and Universal Description. Describe the following example Web services: a.

com is Default.com/calc.config that maps *. To further simplify Web service discovery. The following VSDISCO file automatically exposes all ASMX and DISCO files in a host directory and its subdirectories. and a bug in version 1.disco.asmx?wsdl" docRef="http://www.asmx" /> <scl:contractRef ref="http://www.org/disco/scl/"> <scl:contractRef ref="http://www.NET Framework SDK prevents most DISCO-aware tools from working with VSDISCO anyway. For example.asmx" /> </discovery> If you’d prefer.wintellect.wintellect.Web.wintellect.xmlsoap.Discovery. A client that requests a VSDISCO file gets back what appears to be a static DISCO document.<?xml version="1.wintellect. Including the following HTML in Default.0 of the .vsdisco to System.vsdisco to an HTTP handler that scans the host directory and subdirectories for ASMX and DISCO files and returns a dynamically generated DISCO document.wintellect. My advice is to forget that VSDISCO files even exist and use static DISCO files instead.org/disco/"> <discoveryRef ref="http://www.xmlsoap.2000-03-17"> <exclude path="_vti_cnf" /> <exclude path="_vti_pvt" /> <exclude path="_vti_log" /> <exclude path="_vti_script" /> <exclude path="_vti_txt" /> </dynamicDiscovery> How does dynamic discovery work? ASP.disco): <html> <head> <link type="text/html" rel="alternate" href="Default.com/Calc. you can link to a master DISCO file from your site’s default HTML document. Here’s a DISCO file that points to other DISCO files.wintellect.html and that the same directory also holds a discovery document named Default. You can re-enable it by un-commenting the line in the httpHandlers section of Machine.wintellect.0" ?> <dynamicDiscovery xmlns="urn:schemas-dynamicdiscovery:disco.com/locator.disco"> </head> </html> .html enables most tools that read DISCO files to accept the URL www.NET maps the file name extension . For security reasons.com (as opposed to www.asmx?wsdl" docRef="http://www. Microsoft highly discourages dynamic discovery for fear of compromising your Web server. you can write DISCO files for individual Web services and reference them in a master DISCO file using discoveryRef elements. Microsoft disabled dynamic discovery just before version 1.disco" /> </discovery> A third option is to deploy a VSDISCO file to enable dynamic discovery.com/default.wintellect.com/locator.com/calc. URLs can be absolute or relative: <?xml version="1.xmlsoap. Once more.com/Locator.0 of the . with the exception of those subdirectories noted with exclude elements: <?xml version="1.Services.0" ?> <discovery xmlns="http://schemas.wintellect.DiscoveryRequestHandler and granting the ASPNET account permission to access the IIS metabase.org/disco/" xmlns:scl="http://schemas.0" ?> <discovery xmlns="http://schemas.disco" /> <discoveryRef ref="http://www. suppose the default HTML document at www.NET Framework shipped.

exe utility that comes with the . but operator sites typically limit the publisher API to registered members. to a set of worker processes) that services a group of applications. process boundaries separate each worker process from other worker processes so that when an application is routed to one application pool. and Ariba and supported by hundreds of other companies. If. you can set the application pools worker process to recycle when the application exceeds a specified number of requests.0) When you run IIS 6. Microsoft. So how do you find a Web service if you don’t even have a URL to start with? Can you spell U-D-D-I? 8.0) b. anyone is free to publish a UDDI-based business registry. For example. The actual placing of UDDI calls will be limited primarily to tools vendors and to clients that wish to locate and bind to Web services dynamically. By using an application pool. they’ll use high-level tools such as Visual Studio .0 in worker process isolation mode. you can assign specific configuration settings to a worker process (or.NET SDK featuring managed wrapper classes that simplify interactions with UDDI business registries. or a virtual directory. so does the Disco. By creating new application pools and assigning Web sites and applications to them.NET to query UDDI business registries and generate wrapper classes that allow them to place calls to the Web services that they find there. Disco’s chief disadvantage is that you can’t read a DISCO file if you don’t have its URL. a Web site.NET (specifically. At the time of this writing. you can isolate different Web applications or Web sites in pools. If another application fails because of the volume of requests that it receives. in the case of a Web garden. Most developers will never deal with UDDI APIs directly. Microsoft was beta testing a UDDI . reliable. The URLs that you assign to an application pool can be for an application. Discovery.Net: a. you can configure worker process recycling. 4.Visual Studio . Anyone can call the inquiry API. Jointly developed by IBM.NET Applications Creating Application Pools (IIS 6. Instead.NET Framework SDK. In an application pool. which are called Application Pools. No one company owns the databases. you might configure the application pools worker process to recycle when its memory use reaches a certain threshold. a Web directory. UDDI sites are themselves Web services. Creating Application Pools (IIS 6. you suspect that an application has a memory leak. Operator sites have already been established by IBM and Microsoft and are likely to be the first of many such sites that will come on line in the future. for example. They publish a pair of SOAP-based APIs: an inquiry API for inquiring about companies and their Web services and a publisher API for advertising a company’s Web services. UDDI is a specification for building distributed databases that enable interested parties to ―discover‖ each other’s Web services. which offers several configuration options to match the needs of each application. and secure. and Integration. you can make your server more efficient. Describe the following with respect to Web site deployment in ASP.8 Web Service Discovery – UDDI UDDI is an abbreviation for Universal Description. its Add Web Reference command) reads DISCO files. applications in other application pools do not affect that application. An application pool is a group of URLs that are routed to one or more worker processes that share the same configuration. Deploying ASP. and ensure that your applications remain .

Click OK. even when the worker process serving the new application pool has problems. Directory. such as Network Service in the IIS_WPG group. Any Web site. 3. This isolates the test version of the application. right-click the application pool that you want to use as a template. in Application pool name box. expand the local computer. click the appropriate setting. 5. and then use the runas command to run IIS Manager as an administrator. type a new ID. In IIS Manager. Configuring Application Pools in IIS 6. As a security best practice. n on the same server with the production version of the application. Application pools allow you to apply configuration settings to groups of applications and the worker processes that service those applications. At a command prompt. right-click the application that you want to assign to an application pool. set of properties. Virtual Directory. create a unique application pool for that application. By creating new application pools and assigning Web sites and applications to them. log on to your computer by using an account that is not in the Administrators group. Steps to create a new Application Pool: 1. . Because applications in an application pool are separated from other applications by worker process boundaries. type runas /user:Administrative_AccountName "mmc %systemroot%\system32\inetsrv\iis. or virtual directory can be assigned to an application pool.0 is available only when running in worker process isolation mode. Assigning an application to an application pool: IIS Manager. an application in one application pool is not affected by problems caused by applications in other application pools.msc". An application pool is a configuration that links one or more applications to a set of one or more worker processes. and then click Properties. you can make your server more efficient and reliable. type the name of the new application pool. create an individual application pool for each Web site. separate the two versions into different application pools. 2. Under Application pool settings.available even when a worker process serving an application pool is recycled because of a faulty application. 4. and then click Application Pool. Use an account with the least user rights possible. Note: You must be a member of the Administrators group on the local computer to perform the following procedure or procedures.0) Note: This feature of IIS 6. Web directory. as well as making your other applications always available. right-click Application Pools. or Home Directory tab. If you click Use existing application pool as template. If the ID that appears in Application pool ID box is not the ID that you want. In the Application pool name box. Guidelines for Creating Application Pools the same computer.0 (IIS 6. point to New. application pool.

Web applications that run in-process in IIS 5. ode is the same as configured on the previously-installed version of IIS 6.e is filled in. worker processes run with the Network Service identity. Application pool list box.0 isolation mode. you can run applications that are incompatible with worker process isolation mode because they were developed for earlier versions of IIS.0 application mode run as LocalSystem. IIS manages them by shutting down and redeploying faulty resources and connecting faulty processes to analytical tools. When problems occur. Use worker process isolation mode unless you have a specific compatibility issue that makes the use of IIS 5.0 isolation mode. Worker processes operate independently of each other.  IIS 5. By default. execute. The pooling of applications protects applications from the effects of worker processes that support other application pools. they can fail without affecting other worker processes.0 isolation mode necessary. About Configuring Servers for Applications (IIS 6. and over-utilized resources. applications can be configured to run in separate application pools.0 delivers Web hosting services through an adjustable architecture that you can use to manage server resources with improved stability. In this way.0 depends on whether you perform a clean installation or an upgrade. When you run IIS in worker process isolation mode. IIS separates applications into isolated pools and automatically detects memory leaks. and then type a name.0 running in worker process isolation mode with little or no modification.0 in IIS 5. Worker process isolation mode provides better default security for running Web applications than IIS 5. click the name of the application pool to which you want to assign the Web site.0.0 should run correctly on IIS 6. With this mode. maintain compatibility with your existing applications.0) Internet Information Services (IIS) 6. . Each application pool is a logical representation of a configurable worker process and links to the applications in the pool. efficiency. click Create. The default isolation mode upon installing IIS 6. The Network Service account has lower access rights than the default account for IIS 5.0 isolation mode. The LocalSystem account can read. If the Applicationname box is not filled in. Applications that run correctly on IIS 5.0 isolation mode. IIS can run in either of two mutually exclusive modes of operation: of the World Wide Web Publishing Service (WWW service) from the effects of errant applications. which runs all Web applications in an isolated environment. applications are protected from each other. Web sites that serve static content or simple ASP applications should be able to move to IIS 6. and it protects applications from each other by using the worker process component. Worker Process Isolation Mode IIS 6. defective processes. and change most of the resources on the computer.0 introduces worker process isolation mode. and performance.

Process Affinity enables the connection of worker processes to specific processors on multiCPU servers. HTTP. HTTP. avoiding process-switching overhead. Meanwhile. To further protect your WWW service.NET Applications Deploying ASP. Hypertext Transfer Protocol (HTTP) requests are routed directly to an in-kernel application pool queue serving the configured application.NET applications and the Microsoft . IIS 6.NET is supported .sys. Version 1. Worker processes that serve an application pool pull the requests directly from the queue. This chapter describes how to deploy ASP.sys) and WWW Service Administration and Monitoring. Self . Deploying Your ASP. the WWW service detects that the worker process is unhealthy and shuts it down.0. Most ASP.NET Applications in IIS 6. Overview of Deployment process using IIS 6.0 (IIS 6. CPU Limiting This monitoring feature enables controlling the amount of CPU resources that an application pool consumes in a configured amount of time.0 ASP.Healing Automated management provides auto-restart of failed worker processes and periodic restart of deteriorating worker processes.  Automated Debugging The debugging feature enables the automatic assignment of failing worker processes to debugging tools.0 isolates critical World Wide Web Publishing Service (WWW service) components. IIS 6.0) Microsoft® Windows® Server 2003 includes support for ASP.sys has requests queued).NET Framework. Scalability Web gardens allow more than one worker process to serve the same application pool.NET Framework version 1.NET applications run without modification on version 1. When a worker process enters an unhealthy state. the WWW service starts a new worker process to pick up the queued requests from HTTP. If there is demand for a new worker process to serve requests (HTTP.0 worker process isolation mode delivers the following specific improvements over earlier versions of IIS: Robust Performance Isolation prevents Web applications and Web sites from affecting each other or the WWW service.1 of the .In worker process isolation mode. ASP.1 of the . such as the HTTP protocol stack (HTTP.sys continues to process requests.1 with the operating system installation. Even though a worker process has failed. from the effects of third-party code running in worker processes.sys receives and queues requests for WWW services.NET is a unified Web application platform that provides services to help you build and deploy enterprise-class Web applications and XML-based Web services.NET Framework is installed with Windows Server 2003. the WWW service continues to process requests and shields the user from experiencing a loss of service. Reboots of the operating system and restarting of the WWW service are avoided.NET applications on a newly installed server running Internet Information Services (IIS) 6. and thus stops processing requests.

except for the <processModel> section of the Machine. the settings in the <processModel> section of the Machine.0 The process for deploying new ASP.config files are configured the same way in IIS 6. Windows® Server2003. All the ASP. some of the attributes in the <processModel> section of the Machine. However.NET applications.config file are configured in the same way as they were in IIS 5. complete the following steps: ork.NET Framework version 1.NET applications on a newly installed Web server requires no understanding of earlier versions of IIS or the .0. and Windows® Server2003. Enterprise Edition.on the Microsoft® Windows® Server 2003. you might need to configure the ASP.NET Framework. Datacenter Edition. When IIS 6. Add or Remove Programs in Control Panel.config or Web. to run ASP.NET applications need to retain session state. Standard Edition. Web Edition operating systems. However.NET applications.0 is configured to run in worker process isolation mode. When you configure IIS 6. you will have a Web server running IIS 6. with the default options.config file are now in equivalent IIS 6.NET Applications in IIS 6. you can further configure the Web server to improve the security and availability of your ASP.config file. Before you begin this process.0.0 to use the appropriate ASP. you must also install IIS 6.0 metabase properties.NET application session state method.NET is not available on the following operating systems: Microsoft® Windows® XP 64-Bit Edition. The process for deploying ASP.config files.NET applications in IIS 6. Deployment Process using IIS 6. ASP.0 to run in IIS 5. you must configure IIS 6.NET applications on a newly installed IIS 6.0 . Upon completing the process described in this section.1 as a part of Windows Server 2003. Windows® Server2003. Enterprise Edition. Depending on the method you select. if your ASP. The deployment process presented in this section describes how to deploy ASP.NET configuration sections in the Machine.NET is installed with the Microsoft . the 64-bit version of Windows® Server 2003.0 isolation mode.config and Web.NET state service or Microsoft SQL Server™ to act as the repository for centralized state storage.NET applications. and the 64-bit version of Windows® Server 2003.0 Web server.0 – in the Machine. ASP. In addition. Datacenter Edition.0 and hosting your ASP.0 is shown in Figure Deploying ASP.

You must also enable ASP.NET applications. Create Web sites and virtual directories for each ASP.NET session state by completing the following steps: Step-1: Select the method for maintaining and storing ASP.0 on the Web server. Enable ASP.4: Configure encryption and validation keys. Install and configure IIS 6.NET applications on a production server. Deploying the Web Server .0) You must install the Web server before you can install your ASP.Note: Before deploying your ASP.NET state service. Install Windows Server 2003.NET state service. Step . Copy ASP.3: If you have decided to maintain session state with SQL Server.NET session state connection string.5: Configure ASP. Step . Step . Step . perform the process outlined in this section on a test server that is configured identically to your production server. 3.NET application by doing the following: e virtual directories. you must install and configure IIS 6.NET so that the Web server can run ASP.NET application content to the Web server. Complete the ASP.NET in the Web service extensions list.2: If you have decided to maintain session state with the ASP. 2. below illustrates the process for deploying the Web server. 3.NET to use the appropriate session state.0. Install ASP.NET applications.NET session state. Enable common storage for ASP. Deploy the Web Server 1. 2. configure out-ofprocess session state with SQL Server. Step . configure out-of-process session state with the ASP.6: Secure the ASP. In addition to installing Windows Server 2003.NET Application Deployment Deploying the Web Server (IIS 6.NET Applications 1.

Enabling ASP.0) After the Web server is deployed. If you enabled ASP.1.NET in the Web Service Extensions List (IIS 6.NET v1. If ASP. In this case. view the Web service extensions list in IIS Manager and configure the status of the ASP. Enabling unnecessary components and services increases the attack surface of the Web server.0 with the default options in Add or Remove Programs in Control Panel. then you can continue to the next step in the deployment process.NET application in the corresponding Web site and virtual directory. Then you need to install each ASP.NET by using this method. If you use other methods for installing and configuring Windows Server 2003.NET Applications (IIS 6. Because the provisioning and setup scripts create the Web sites and virtual directories while installing ASP.NET.NET applications. the default configuration settings might be different. you must create a Web site and virtual directories for each ASP.0. As with installing Windows Server 2003.0 is to ensure that the security of the Web server is maintained. your configuration settings might be different. The deployment process presented here assumes that you install IIS 6.NET is also enabled in the Web service extensions list. The deployment process assumes that you quit Manage Your Server. and then further configure the Web server in Add or Remove Programsin Control Panel.0) The deployment process presented here assumes that you install Windows Server 2003 with the default options. use these scripts to install the ASP. you need to enable ASP.NET might not be enabled in the Web service extensions list if either of the following is true: Web download or as part of an application such as the Microsoft Visual Studio® . such as unattended setup.0.NET in Add or Remove Windows Components. run the provisioning or setup scripts to install and configure the Web sites and applications.0.0 (IIS 6. If you use other methods for installing and configuring Windows Server 2003. You can help ensure that the Web server is secure by enabling only the essential components and services in IIS 6.NET applications on the Web server.NET applications.NET applications. and then continue to the next step in the .NET applications.NET application. the primary concern when installing and configuring IIS 6. When there are provisioning or setup scripts for your ASP. which is accessible from Add or Remove Programs in Control Panel.NET development tool. you do not need to perform any manual steps to install the ASP.NET in this way. Note: When you complete the installation of Windows Server 2003. such as Manage Your Server.NET is not already enabled.0 with only the essential components and services. Manage Your Server automatically starts.NET applications on an existing Web server. ASP. When you enable ASP.Installing Windows Server 2003 (IIS 6.0) After you install IIS 6. You can enable ASP.NET is not Enabled ASP. install FrontPage 2002 Server Extensions from Microsoft on the Web server. ASP.0) Because IIS 6. First. Installing ASP. ASP.0 is not installed during the default installation of Windows Server 2003. Installing and Configuring IIS 6.0 by completing the following steps: Step – 1: Install IIS 6. you can install your ASP. Step – 2: If you want to manage the Web site content by using Microsoft® FrontPage®.4322 Web service extension to Allowed. Install and configure IIS 6. the next step in deploying the Web server is to install and configure IIS 6.

As a security measure. The folder can be created on the same computer as the Web server or on a Universal Naming Convention (UNC)–shared folder on a separate server.NET applications into their corresponding Web sites and virtual directories.NET returns a 404 error for all requests containing /bin in the requested URL. . Create a Web site and home directory for an ASP. which reduces the potential of an attack on a Web site bringing down the entire Web server and improves performance.NET Application (IIS 6.4 below illustrates the process for installing your ASP. Step – 2: Create the Web site on the server.0 Each Web site must have one home directory. At a minimum.NET application. Installation Process for ASP.NET application by completing the following steps: Step – 1: Create the folder that will be the home directory for the Web site on the Web server. Creating Web Sites and Home Directories Using IIS 6.NET applications by completing the following steps: tories. URL. The home directory is mapped to the domain name of the Web site or to the name of the Web server. ASP. create the folder on the following: volume. The folder that is the home directory of the Web site contains all of the content and subdirectories for the Web site.NET applications. The home directory is the central location for your published Web pages.0) For each ASP.NET Applications Creating Web Sites and Virtual Directories for each ASP. Later in the installation process. you will install your ASP. Create the Web sites and virtual directories for your ASP. you must create a virtual directory in a new or existing Web site.application deployment process. Figure 9. It contains a home page or index file that serves as a portal to other pages in your Web site.

if the application has been developed by using Visual Studio .NET application content to the Web server on an intranet or internal network. and provide a user name and password for access rights. Clients can access different servers in the Web farm across multiple requests and still have full access to session data. You can enable common storage for ASP.NET application. For each virtual directory required by the ASP. Creating Virtual Directories (IIS 6. For security reasons. then configure the Web site on the Web server to be FrontPage extended. 2. you might want to move the Web site content to a different disk volume during the application deployment process. Create the virtual directory under the appropriate Web site on the server.Step – 3: If the Web site is FrontPage extended. You can use virtual directories to specify the UNC name for the location where the content is placed.NET application content to the Web server by using one of the following methods: Xcopy command to copy ASP. even though it is not. Note: FrontPage Server Extensions must be installed on the Web server to use the Copy Project command. Ensure that you create the folder in a secure manner that does not compromise the security of the Web server. you can copy the content of the ASP.NET Application Content (IIS 6. which corresponds to a physical directory on the Web server or a Universal Naming Convention (UNC) location.0) ASP.NET Session State (IIS 6. 1.0) A virtual directory is a folder name.NET application content to the Web server on an intranet or internal network. You can move the content to another disk volume on the Web server or to a shared folder on a separate server. if the Web site that contains the application has been developed using FrontPage.NET session state by performing the following steps: . Enabling Common Storage for ASP. an intranet or internal network.NET. You can copy the ASP. This is also sometimes referred to as URL mapping. Copy Project command in Visual Studio . the content appears to be in a subdirectory of the home directory.NET application content to the Web server on an intranet or over the Internet. create a corresponding virtual directory on the Web server by completing the following steps: Create the folder on the Web server to contain the virtual directory content.NET application to the corresponding Web site and virtual directories that you created on the Web server.NET application. When clients access content in a virtual directory.0) When no installation program or provisioning scripts exist for your ASP.NET session state lets you share client session data across all of the Web servers in a Web farm or across different worker processes or worker process instances on a single Web server. Publish Web command in FrontPage to copy ASP. Virtual directories are used to publish Web content from any folder that is not contained in the home directory of the Web site. Copying ASP.NET to copy ASP. used in an address.

NET state service.NET session state.1. Configure the encryption and validation keys. If you have decided to maintain session state with SQL Server.NET state service.NET to use the session state method that you selected in Step 1.NET session state connection string in the registry . configure out-of-process session state with SQL Server. 3. 2. 6. Select the method for maintaining and storing ASP. configure outof-process session state with the ASP. 4. Configure ASP. Secure the ASP. 5. If you have decided to maintain session state with the ASP.