Monday, 21 January 2013

web application

Visual Studio ASP.NET Web Applications

A Visual Studio Web application is built around ASP.NET. ASP.NET is a platform — including design-time objects and controls and a run-time execution context — for developing and running applications on a Web server.
ASP.NET in turn is part of the .NET Framework, so that it provides access to all of the features of that framework. For example, you can create ASP.NET Web applications using any .NET programming language (Visual Basic, C#, Managed Extensions for C++, and many others) and .NET debugging facilities. You access data using ADO.NET. Similarly, you can access operating system services using .NET Framework classes, and so on.
ASP.NET Web applications run on a Web server configured with Microsoft Internet Information Services (IIS). However, you do not need to work directly with IIS. You can program IIS facilities using ASP.NET classes, and Visual Studio handles file management tasks such as creating IIS applications when needed and providing ways for you to deploy your Web applications to IIS.


User Interface: Web Forms and the ASP.NET Page Framework

You can create HTML pages and Web Forms pages as the user interface for your application. HTML pages are generally used for static content. In contrast, Web Forms pages give you a programmable interface that works much like a Visual Basic form, except that the user interface is rendered in a Web browser or other Web device.
Note You can use a Windows Form as the user interface in an application that calls XML Web services. For an example, see Walkthrough: Creating a Distributed Application.
Web Forms pages are built on the ASP.NET Page framework. Each Web Forms page is an object that derives from the ASP.NET Page class, which acts as a container for controls. The page actually consists of two files: an .aspx file that contains the UI elements (static HTML text and control elements) and a class file that contains the code that runs the page. For details, see Introduction to Web Forms Pages.
When users request a Web Forms page, the Page framework runs the Web Forms page object and all the individual controls on it. The output of the Page class and of the controls is HTML. For details, see Web Forms Page Processing.
Because the Web is inherently stateless — by default, components in a Web application are alive only long enough to process a single request — Web applications face challenges in preserving values as the user works with the application. To help, the Page framework includes facilities for managing state. These include page-based "view state" (a method for preserving values in controls) and access to non-page-based state facilities such as Session state (user-specific) and Application state (global to the application). For details, see Web Forms State Management.
The Page framework supports a set of controls you can use to program user interaction with your Web Forms pages. User actions in the form are captured and processed by the Page framework in a way that lets you treat them as standard events. You can choose from a large selection of controls available in Visual Studio. In addition, you can create your own custom controls. For details, see Introduction to Web User Controls and Developing ASP.NET Server Controls.


Web Application Data Access

Most ASP.NET Web applications involve at least some level of access to data. ASP.NET does not directly include data access facilities. Instead, Web applications use ADO.NET data services.
ADO.NET provides a complete framework for accessing and managing data from a variety of sources, including databases and XML files or streams. ADO.NET includes providers — classes that allow you to connect to data sources, execute commands, and read results. You can optionally keep data in a dataset, which is a disconnected, in-memory cache.
Data access in Web applications, whether in a Web Forms page or an XML Web service, introduces special challenges:
  • Statelessness The components of Web applications usually do not preserve state, which makes it impractical to maintain live connections to a data source (or other resources).
  • Scalability Because Web applications can have user loads that vary substantially over short periods of time, data access has to be designed with scalability in mind.
Visual Studio provides a variety of tools for working with data, including Toolbox support for data elements, various configuration wizards, and so on. The following topics provide information on data in general — that is, ADO.NET — as well as about using data in Web applications.

No comments:

Post a Comment