Condividi tramite


Designing ASP.NET Applications

Designing ASP.NET applications is quite different than designing ASP applications. This topics describes some preliminary design issues and provides links to relevant topics in the .NET Framework SDK.

Security

When designing your ASP.NET application, think about security, especially the type of authentication that will be used (Forms, Windows, or Passport), and how sensitive information is stored (username and password). A good reference is Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication, available in the ASP.NET SDK.

Scalability

It is possible to combine HTML and script on a single page as with previous versions of ASP.NET (called a single-file page) but for all but the simplest pages, the code-behind model should be used. With code-behind, the ASP.NET executable code is placed in a separately compiled DLL, called the code-behind class file, and the .aspx page contains only HTML and ASP.NET server controls. Code-behind design is much more scalable and is much easier to maintain. See the topic titled Introduction to Web Forms Pages in the ASP.NET SDK.

Converting ASP Applications to ASP.NET Applications

Please see the articles titled Migrating ASP Pages to ASP.NET and Microsoft .NET/COM Migration and Interoperability in the ASP.NET SDK.

Converting ISAPI Applications to .NET HTTP Modules

HTTP Modules are equivalent to ISAPI filters. They enter the execution pipeline before any handler sees the request and just after all handlers have done their work. HTTP Handlers are equivalent to ISAPI extensions. HTTP module classes must inherit the IHTTPModule interface. HTTP handlers must inherit IHttpHandler. IIS executes an ISAPI filter by calling the HttpFilterProc() method in the filter. ASP.NET executes code in a module in response to an event in the execution pipeline such as Application_OnStart, Session_OnStart or Session_OnEnd. When IIS issues a request to ASP.NET, ASP.NET examines the <HTTPMODULES> and <HTTPHANDLERS> section of all configuration files that apply to the application in order to find modules and handlers that apply to the file name extension (.aspx, for example). If modules or handlers are found, the request is routed to the appropriate code.

Handlers and modules can be built in any language that the framework supports, even Visual Basic?.

See the topics titled HTTP Handlers and HTTP Modules in the ASP.NET SDK.