How to: Create a Web Client Solution
The Web Client Solution templates unfold a Visual Studio solution you can use as a starting point for your Web client application. The solution includes recommended practices and techniques; it is the basis for the procedures and automated guidance included
in the Web Client Software Factory.
Visual Studio 2005 Service Pack 1 supports two types of Web project models: the Web Site Project module (new in Visual Studio 2005) and the Web Application project model (similar to the project model used in Visual Studio 2003). The software factory includes
solution templates for both Web project modules.
This topic describes how to unfold a Web Client Solution template.
The Web Client Solution template requires the following (included with the Web Client Software Factory):
- The Composite Web Application Block
- The Enterprise Library 3.1 – May 2007
The following procedure describes how to unfold the Web Client Solution template.
To unfold a Web Client Solution template
The Web Client Solution project template.
- In Visual Studio, point to New on the File menu, and then click
- In the left pane of the New Project dialog box, expand Guidance Packages, and then click
Web Client Development October 2007, as shown in Figure 1.
- In the Templates pane, select the template for the type of Web project model and development language that you want.
This release of the Web Client Software Factory supports Web sites that use the Web Application project model. If you create your Web site as a Web Application project, you have the option to create business modules as sub-Web Application projects. Use the
templates with the identifier “WAP” in the template name to create Web sites that use the Web Application project model. Use the templates with the identifier “Web Site” in the template name to create Web sites that use the Web Site Project model. For more
information about Web Application projects, see
Introduction to Web Application Projects
The Create Web Solution recipe wizard.
- (Optional) Change the name of the solution in the Name box and the location of the solution in the
- Click OK. The Web Client Solution template references the Create Solution recipe. The Guidance Automation Extensions framework calls the recipe when it unfolds the template. The Create Solution recipe starts a wizard to gather information that it
uses to customize the generated source code. Figure 2 illustrates the first page of the wizard.
- (Optional) Modify the location of the Composite Web Application Block and Enterprise Library assemblies. The names of the required assemblies appear under
Required application block assemblies. The default location is the Microsoft Practices Library folder of the Web Client Software Factory, in case it is installed. (The wizard validates that all required assemblies exist at the specified location; any
required assemblies that are not at that location are displayed in red.)
- Enter the root namespace for your application. This value appears as the first part of every namespace in the generated solution.
- (Optional) Select the Enable ASP.NET AJAX Support check box. If you select this check box, the Web site (or Web Application project) to be created by the recipe will be AJAX-enabled.
- (Optional) Select the Show* documentation after recipe completes* check box. If you select this check box, a summary of the recipe actions and suggested next steps appear after the recipe completes.
- Click Finish. The recipe unfolds the Web Client Solution template.
You will have a Web client solution you can use as starting point for building and testing your Web client application. The Web client solution includes a Web site with a business module named
. This module is associated with the root folder of the Web site. This means that all pages in the root Web site folder belong to the
module registers the following global services:
- SiteMapBuilderService. Business modules use this service to register site map nodes. The
Shell module uses this service to register the Home site map node.
- EnterpriseLibraryAuthorizationService. This service uses the Enterprise Library Security Application Block to provide authorization.
illustrates the solution structure of the Web client solution.
The Web client solution.
The Web Client Solution template generates a functional Web site with a default home page. If you run the application, you will see the page illustrated in
The default home page of the Web Client Solution project.
The following are typical tasks that you perform after you create a Web client solution:
- Define visual styles. The Web Client Solution template includes an
ASP.NET theme named Default. You can update this theme or create your own application-specific theme.
- Create global Web pages. Frequently, a Web site contains global pages that are accessible to all users. For example, a page that displays Help information, a page that users use to log on to the site, or a page that displays error information. You
can use the Add View (with presenter) recipe to create these global views. For information about how to run the recipe, see
How to: Add a Page with a Presenter.
- Add business modules. Business modules are units of development and deployment that typically include a combination of related Web pages, page flows, business logic, and services. With modules, you can encapsulate a set of concerns of your application
and deploy them together. To create a business module, run the Add Business Module recipe on a solution folder. For information about how to run the recipe, see
How to: Create a Business Module. The following are examples of business modules:
- A module that contains a specific application feature area, such as reports
- A module that contains use cases around a specific back-end system, such as loan processing
- Add foundational modules. Foundational modules encapsulate infrastructure services and do not contain Web pages. An example of a foundational module is a module that contains services for logging and authorization. To create a foundational module,
run the Add Foundational Module recipe on a solution folder. For information about how to execute the recipe, see
How to: Create a Foundational Module.