Thursday, January 1, 2009

Introducing ASP.NET Applications

Overview of ASP.NET Applications

An ASP.NET application is a collection of files, handler classes, and executable code that reside in a common virtual directory on a Web server. Valid ASP.NET files include the following:

  • Web forms: A Web form (*.aspx) provides a programming model for building user interface pages for a Web application. You construct Web forms using standard Hypertext Markup Language (HTML) mixed with server-side HTML, Web, and custom user controls. Web forms provide code-behind files, which include programmatic access to a Page handler object. You can code behind the Page object's lifecycle events using any standard .NET-compliant language. The filename suffix of the code-behind file reflects the language the code is written in—for example, *.aspx.vb for Visual Basic .NET (VB .NET) code or *.aspx.cs for C# code. In addition, ASP.NET continues to support the classic ASP usage of inline server-side code mixed with HTML. However, this approach is not recommended for ASP.NET applications because it does not cleanly separate client-side and server-side codebases.
  • Web services: These are components that can be invoked remotely by client applications or other Web services, using Extensible Markup Language (XML) over Hypertext Transfer Protocol (HTTP) formatted in Simple Object Access Protocol (SOAP) envelopes. Web services are based on industry-standard specifications and can be consumed by heterogeneous clients on different platforms. Web services consist of an *.asmx file containing basic directives, plus a code-behind file that contains the methods and logic for the Web service. Visual Studio .NET is a powerful tool for creating XML Web services because it handles complex compilation details for you.
  • User controls: You can save Web forms as reusable components called user controls, which resemble Web forms in almost every way except that the file type uses an .ascx extension. You can drop user controls onto Web forms much like you can a standard server control, or you can dynamically load them onto the Web form at runtime. User controls provide a sophisticated way to reuse code and allow shared code to be maintained in a single location. User controls are also useful for implementing fragment caching in a Web form.
  • Code modules: These are stand-alone code module files that contain application-scope functions; any Web form, or module, in the application can call them. You can partition a single code module into several classes within one or more namespaces. Additionally, you can compile the code modules directly into the application executable, or you can move them to separate projects and compile them as stand-alone .NET components. You can write code modules in any .NET-compliant language, including VB .NET and C#.
  • Client-side scripts: For all of the server-side power of ASP.NET, client-side scripting still plays an important role. ASP.NET makes it easy to delegate a control's client-side events to server-side functions. But sometimes it is most efficient to handle the event on the client, using JavaScript or a similar scripting language. ASP.NET allows you to add client-side scripts to a project. Visual Studio .NET provides limited IntelliSense for JavaScript, as well as the ability to debug client-side scripts.
  • Web.config: This XML-based file stores configuration settings for ASP.NET applications.
  • Global.asax: This file is the successor to the global.asa file from classic ASP. It provides programmatic access to application and session lifecycle events

Hire Me

Follow me on Facebook

Follow me

Do you find this Blog helpful?

Follow by Email

About Me

My Photo
Expert Senior Software Developer

Microsoft Business Card