Tuesday, February 2, 2010

ASP.NET overview

  • ASP.NET is tool for creating Web Application.
  • ASP.NET is Server Side Scripting technology.
  • ASP.Net is a part of Microsoft .Net framework.
  • Like ASP, ASP.NET also runs inside IIS.
  • When browser requests an ASP.NET file, IIS passes the request to ASP.NET engine which after having executed the script sends file back to browser as a simple HTML page.
  • ASP.NET is not backward compatible with classic ASP.
  • Unlike interpreted classic ASP, ASP.NET is compiled CLR code.
  • Being part of CLR, it has advantages of early binding, JIT compilation, caching services, Garbage collection etc.
  • ASP.NET uses ADO.NET for data access and well integrated with VB.NET, C#.Net, Jscript etc.
  • ASP.NET provides two sets of controls - HTML and Server control.
  • ASP.NET employs a text-based configuration settings, no need to restart server in case of change in setting.
  • ASP.NET executes new code on request, no need to restart server in case of change in code.
  • ASP.NET is the platform to create Web applications and Web services.
  • ASP.NET runs under IIS.
  • It is tightly integrated with the Microsoft server, programming, data access, and security tools.
  • ASP.NET is part of the .NET Framework and is made up of several components like Visual Studio .NET Web development tools, System.Web namespaces, Server and HTML controls.
  • VS.NET Web development tools: Tools for designing Web pages and application templates, project management, and deployment tools for Web applications.
  • System.Web namespaces: Part of the .NET Framework that include classes.
  • Server and HTML controls: User-interface components.
  • Advantages of ASP.NET
    Executable of Web application is compiled that runs faster than interpreted scripts,
    Automatic state management for controls,
    Access to the .NET Framework,
    Introduction of VB.Net that is evolution version of VB, fully support object-oriented Programming,
    New Visual C# programming language,
    The ability to create new, customized server controls from existing controls,
    Built-in security through the Windows server or other authentication/authorization methods,
    Integration with ADO.NET,
    Full support for XML and CSS,
    Built-in features for caching frequently requested Web pages on the server.
  • Navigation sequence of ASP.NET web form
    IIS starts the ASP.NET worker process which loads the assembly,
    The assembly composes a response to the user,
    IIS returns the response to the user in the form of HTML.
  • ASP.NET Web Form Components
    Server controls: Define the user interface of a Web form and built-in features for saving data.
    HTML controls: Visual element provided by HTML. They are useful when the more complete feature of server controls is not needed.
    Data controls: Data controls connects to SQL and OLE databases and XML data files.
    Examples of such controls are SqlConnection, SqlCommand, OleDbConnection, OleDbCommand, DataSet.
    System components: Provide access to various system-level events that occur on the server. Ex. EventLog, MessageQueue.
  • .NET Framework includes
    An execution engine called CLR and class library.
  • Shared (VB.NET) or static members (C#)
    Class methods can be used directly without first creating an object from the class. Members can be called from the class name. Example  -Math class.
  • Virtual folder: Web applications can exist only in a location that has been published by IIS as a virtual folder. It is shared resource identified by an alias that represents a physical location on a server. The virtual folder named //localhost is the Web root folder on your computer. IIS determines the physical location of your Web root folder. By default, IIS installs the folder on your boot drive at \Inetpub\wwwroot.
  • View state: ASP.NET preserves data between requests using view state. View state is available only within the Web form.
  • State Variable:  allows data entered on a Web form available on other Web forms in an application.
    Application state variables: Available to all users of an application.
    Session state variables: Available only to a single session (user).
  • Application Event Handlers in ASP.NET
    Application_Start:Occurs when first user visits a page.
    Application_End:Occurs when no more users of the application.
    Application_BeginRequest:Occurs at the beginning of each request to the server.
    Application_EndRequest:Occurs at the end of each request to the server.
    Session_Start:Occurs when a new user visits a page within your application.
    Session_End:Occurs when a user stops requesting pages from the Web application and their session times out.
  • Session is a unique instance of the browser. Each user can have multiple instances of the browser.
  • ASP.NET Web Form Events
    Page_Init: Here server controls are loaded and initialized.
    Page_Load: Server controls are loaded in the Page object.
    Page_PreRender: Application is about to render the Page object.
    Page_Unload: Page is unloaded from memory.
    Page_Disposed: Page object is released from memory.
    Page_Error
  • Unhandled exception occurs
    Page_AbortTransaction: Transaction is aborted.
    Page_CommitTransaction: Transaction is accepted.
    Page_DataBinding: Server control on the page binds to a data source.
  • Server Control Events in ASP.NET
    Postback events
    : Events cause the Web page to be sent back to the server for immediate processing. Postback events affect performance because they trigger a round-trip to the server.
    Cached events: Save controls in the page’s view state to be processed when a postback event occurs.
    Validation events: Events occurred before the page is post back to the server.
  • Application domain: The process space where ASP.NET worker process loads the Web application’s assembly, also called as application domain.
  • Namespaces organizes code and provide protection from conflicting names called namespace collisions.
  • Access Modifier for Classes and Modules
    Public (VB.NET) or public (C#): Can be accessed by all members in all classes and projects
    Friend (VB.NET) or internal(C#): Can be accessed by all members in the current project
    Protected (VB.NET) or protected(C#): Can be accessed in the current class and in classes derived from this member’s class
    Protected Friend (VB.NET) or protected internal(C#): Can be accessed by all members in the current project and all members in classes derived from this member’s class
    Private (VB.NET) or private(C#): Can be accessed by members of the current class only

0 Comments: