ASP.NET LIFE CYCLE IN DEPTH - PowerPoint PPT Presentation

About This Presentation
Title:

ASP.NET LIFE CYCLE IN DEPTH

Description:

At the point when a page is requested for, it is executed into the server memory, handled, and sent to the program. Later it is unloaded from the memory. – PowerPoint PPT presentation

Number of Views:37
Slides: 7
Provided by: poojagaikwad

less

Transcript and Presenter's Notes

Title: ASP.NET LIFE CYCLE IN DEPTH


1
ASP.NET LIFE CYCLE IN DEPTHVISIT
http//crbtech.in/Dot-Net-Training/
2
  • ASP.NET life cycle guides in a brief tutorial
    about how
  • - ASP.NET forms pages to create dynamic yield
  • - ASP.NET accumulates the pages progressively
  • - The application and its pages are initiated and
    handled
  • The ASP.NET life cycle could be partitioned into
    two gatherings
  • - Application Life Cycle
  • - Page Life Cycle
  • ASP.NET Application Life Cycle
  • The application life cycle has the certain
    accompanying stages
  • - Client makes a manual request for getting
    access to the source page. Program sends this
    request tothe web server.
  • - A common pipeline gets the main request and the
    accompanying situations take place
  • - An object of the class ApplicationManager is
    made.
  • - An object of the class HostingEnvironment is
    made to give manual data with respect to the
    assets.
  • - Top level things in the application are
    assembled.
  • - Reaction articles are made. The application
    protests, for example, HttpContext, HttpRequest
    andHttpResponse are made and introduced.
  • - An occurrence of the HttpApplication article is
    made and doled out to the request.
  • - The request is handled by the HttpApplication
    class. Diverse occasions are raised by this class
    forhandling the request.

3
  • ASP.NET Page Life Cycle
  • At the point when a page is requested for, it is
    executed into the server memory, handled, and
    sent to the program. Later it is unloaded from
    the memory. In between at every stage, techniques
    and events are accessible, which could be
    rejected or canceled by need of the application.
    Rather, you can compose a manual particular code
    to reject the default code.
  • The Page class makes a tree arranged in order of
    ranks, of all the controls on the page. All the
    elements of the page beside the directives, are a
    part of this control tree.You can see the
    control tree by including trace valid to the
    page mandate. We will cover page directives and
    following under directives and event
    handling.
  • The page life cycle stages are
  • - Initialization
  • - Creation of the controls on the page
  • - Rebuilding and support of the state.
  • - Execution of the event handler codes
  • - Page rendering
  • A thorough tutorial of Page cycle proves
    benificial in any stage of page life cycle.
    Execution of Page Life Study can help in solving
    all errors in between any stage of Page Life.
    This Tutirial additionally helps in creating
    custom controls and executing them at ideal time,
    generate their properties with perspective state
    information and run control behaviour code.

4
  • Taking after are the distinctive phases of an
    ASP.NET page
  • - Page requestWhen ASP.NET gets a page demand,
    it chooses whether to parse and orderthe page,
    or there would be a cached version of the page
    in like manner the reaction is sent.
  • - Beginning of page life cycleAt this stage, the
    Request and Response objects are set. In the
    event thatthe request is an old demand or post
    back, the IsPostBack property of the page is set
    to genuine.The UICulture property of the page is
    additionally set.
  • - Page initializationAt this stage, the controls
    on the page are relegated unique ID by setting
    theUniqueID property and the themes are applied.
    For another requests, postback information
    isstacked and the control properties are
    reestablished to the view-state values.
  • - Page loadAt this stage, control properties are
    set to utilize the view state and control
    statevalues.
  • - ValidationValidate technique for the approval
    control is called and on its fruitful execution,
    theIsValid property of the page is set to
    genuine.
  • - Postback occasion handlingIf the request is a
    postback (old demand), the related eventhandler
    is appealed
  • - Page renderingAt this stage, view state for
    the page and all controls are spared. The page
    calls theRender technique for every control and
    the yield of rendering is composed to the
    OutputStream classof the Response property of
    page.
  • - UnloadThe rendered page is sent to the
    customer and page properties, for example,
    Response andRequest, are emptied and all cleanup
    is done.

5
  • ASP.NET Page Life Cycle Events -
  • At every phase of the page life cycle, the page
    raises a few events, which could be coded. Event
    handling is essentially a capacity or subroutine,
    bound to the event, utilizing definitive traits,
    for example, Onclick or handle.
  • Taking after are the page life cycle occasions
  • - PreInitPreInit is the principal event in page
    life cycle. It checks the IsPostBack property and
    figures out if thepage is a postback. It sets
    the themes and master pages, makes dynamic
    controls, and gets and setsprofile property
    estimations. This event handling can be taken
    care of by over-burdening theOnPreInit strategy
    or making a Page_PreInit handler.
  • - InitInit event introduces the control property
    and the control tree is constructed. This event
    handling canbe taken care of by over-burdening
    the OnInit strategy or making a Page_Init
    handler.
  • - InitCompleteInitComplete occasion permits
    following of view state. All the controls turn on
    view state following.
  • - LoadViewStateLoadViewState occasion permits
    loading view state data into the controls.
  • - LoadPostDataDuring this stage, the elements of
    all the information fields are characterized with
    the ltformgt tag arehandled.
  • - PreLoadPreLoad happens before the post back
    information is loaded in the controls. This event
    can be takencare of by over-burdening the
    OnPreLoad technique or making a Page_PreLoad
    handler.

6
  • - LoadThe Load event is raised for the page
    first and after that repeatedly for all kid
    controls. The controls inthe control tree are
    made. This event handling can be taken care of by
    over-burdening the OnLoadstrategy or making a
    Page_Load handler.
  • - LoadCompleteThe loading procedure is finished,
    control event handlers are run, and page
    validation happens. Thisevent handling can be
    taken care of by over-burdening the
    OnLoadComplete strategy or making
    aPage_LoadComplete handler
  • - PreRenderThe PreRender event happens just
    before the output is rendered. By taking care of
    this event, pagesand controls can perform any
    upgrades before the output is rendered.
  • - PreRenderCompleteAs the PreRender event is
    repeatedly let go for all type of controls, this
    event guarantees theconsummation of the
    pre-rendering stage.
  • - SaveStateCompleteState of control on the page
    is spared. Personalization, control state and
    view state data is spared. TheHTML markup is
    created. This stage can be taken care of by
    abrogating the Render technique ormaking a
    Page_Render handler.
  • - UnLoadThe UnLoad stage is the last period of
    the page life cycle. It raises the UnLoad event
    for allcontrols repeatedly and in conclusion for
    the page itself. Last cleanup is done and all
    assets andreferences, for example, database
    associations, are liberated. This event handling
    can be taken care ofby changing the OnUnLoad
    strategy or making a Page_UnLoad handler.
  • For .NET training and placement reviews, please
    do visit CRB Tech Reviews.
  • RELATED ARTICLES
  • Here Are Few Tips on Asp.Net Life Cycle
  • Top 5 Standards To Follow While Coding In VB .Net
Write a Comment
User Comments (0)
About PowerShow.com