The Wayback Machine - https://web.archive.org/web/20110608150209/http://prismwiki.codegear.com:80/en/ASP.NET_Web_Projects

ASP.NET Web Projects

From Delphi Prism

Jump to:navigation, search

This is a Platform topic
Feel free to add your notes to this topic below.


Overview

This kind of web site is project-based like other Prism projects, without some of the additional directory structures (like App_Data) that you find in a directory-based web site. However, one trade-off is that you can only use one language per site; any C# you want to bring in must be in a separate class library.

The non-ASP.NET files (.asmx, .aspx, .ashx) of Web Projects are compiled by the IDE as a class library to the Bin/ directory that will be referenced by the the ASP.NET code. For directory-based web sites, see Web Sites.

New web projects are started via the File | New | Project dialog, just like other Prism projects. Simply navigate to the Web folder under Delphi Prism and select the kind of site you want to use.

NewWebAppAero.png

Once a new website has been created, new elements can be added to the project via the New Items dialog, as in a non-web project:

AddNewItemToWebAppAero.png

Again, unlike in a directory-based web site, all items in a web project have to be in the same language.


Compile time

Unlike ASP.NET Web Sites, all ASP.NET Web Application code source files, including codebehind ones, are compiled into a single assembly. This approach has two major advantages:


Publishing

An ASP.NET Web Application can be deployed in several ways:

You can find more about ASP.NET precompilation in this MSDN article. In other words, you need to use the aspnet_compiler.exe command-line tool to precompile an ASP.NET Web Application. This command, for example,

aspnet_compiler -v TestWebsite -p d:\WebAppDeploy d:\PrecompiledWebApp

takes the assemblies and content files of the WebApplication from the d:\WebAppDeploy folder and precompiles them, placing the result into the d:\PrecompiledWebApp folder. This website should be deployed as TestWebsite (note the -v option), otherwise you'll get errors while trying to access it.


See Also

Prism-48h.png

Area: Delphi Prism Platform

Platform GlossaryKeywordsTypesFAQHow To

Navigation
Areas
Toolbox