Answered Questions

  • ASP .Net Page Life Cycle

    Explain the life cycle of an ASP .NET page.

    Star Read Best Answer

    Editorial / Best Answer

    aanand_agrawal  

    • Member Since Apr-2009 | Apr 30th, 2009


    1. OnInit (Init) Initializes each child control of the current

    2. LoadControlState: Loads the ControlState of the control. To use this method, the control must call the Page.RegisterRequiresControlState method in the OnInit method of the control.

    3. LoadViewState: Loads the ViewState of the control.

    4. LoadPostData: Is defined on interface IPostBackDataHandler. Controls that implement this interface use this method to retrieve the incoming form data and update the control’s properties accordingly.

    5. Load (OnLoad): Allows actions that are common to every request to be placed here. Note that the control is stable at this time; it has been initialized and its state has been reconstructed.

    6. RaisePostDataChangedEvent: Is defined on the interface IPostBackData-Handler. Controls that implement this interface use this event to raise change events in response to the Postback data changing between the current Postback and the previous Postback. For example, if a TextBox has a TextChanged event and AutoPostback is turned off, clicking a button causes the Text-Changed event to execute in this stage before handling the click event of the button, which is raised in the next stage.

    7. RaisePostbackEvent: Handles the client-side event that caused the Postback to occur

    8. PreRender (OnPreRender): Allows last-minute changes to the control. This event takes place after all regular Post-back events have taken place. This event takes place before saving ViewState, so any changes made here are saved.

    9. SaveControlState: Saves the current control state to ViewState. After this stage, any changes to the control state are lost. To use this method, the control must call the Page.RegisterRequiresControlState method in the OnInit method of the control.

    10. SaveViewState: Saves the current data state of the control to ViewState. After this stage, any changes to the control data are lost.

    11. Render: Generates the client-side HTML, Dynamic Hypertext Markup Language (DHTML), and script that are necessary to properly display this control at the browser. In this stage, any changes to the control are not persisted into ViewState.

    12. Dispose: Accepts cleanup code. Releases any unman-aged resources in this stage. Unmanaged resources are resources that are not handled by the .NET common language runtime, such as file handles and database connections.

    13. UnLoad

    Abhijit

    • Apr 1st, 2015

    I wont go in detail but I can write down the sequence of execution.
    1) PreInit
    2) Init
    3) InitComplete
    4) PreLoad
    5) Load
    6) Controls Event (postback events of all controls on page)
    7) LoadComplete
    8) PreRender
    9) SaveSateComplete
    10) Render
    11) Unload



  • Authentication Levels

    How we can set Different levels of Authentication in .Net?What are the difference between Windows Authenticatin, Passport Authentication and Form Authentication?

    Star Read Best Answer

    Editorial / Best Answer

    aanand_agrawal  

    • Member Since Apr-2009 | Apr 30th, 2009


    Windows authentication enables you to identify users without creating a custom page. Credentials are stored in the Web server’s local user database or an Active Directory domain. Once identified, you can use the user’s credentials to gain access to resources that are protected by Windows authorization.

    Forms authentication enables you to identify users with a custom database, such as an ASP.NET membership database. Alternatively, you can implement your own custom database. Once authenticated, you can reference the roles the user is in to restrict access to portions of your Web site.

    Passport authentication relies on a centralized service provided by Microsoft. Passport authentication identifies a user with using his or her e-mail address and a password, and a single Passport account can be used with many different Web sites. Passport authentication is primarily used for public Web sites with thousands of users.

    Anonymous authentication does not require the user to provide credentials.

    Nirmal09

    • Jan 13th, 2011

    Windows Authentication Windows Authentication is the default authentication mechanism for ASP.NET applications. Windows Authentication is implemented in ASP.NET using the Windows authentication&n...

  • Whats the diffrence between Custom Control and a User Control?

    karunakk

    • Jun 2nd, 2008

    Web user controls :- Web User Control is Easier to create and another thing is that its support is limited for users who use a visual design tool one gud thing is that its contains static layout one m...

  • why we need both server controls and html controls in asp.net. what is the difference between them?

    Anilkumar Mantena

    • Jul 24th, 2006

    HTML Server Controls:This controls will follow similar syntax of html client side controls with the same set of properties (with runat="server" attribute).  The purpose of this HTML Server contro...

  • What is the difference between inline coding & code behind.

    Manish Srivastava

    • Feb 20th, 2007

    When we write inline code we write code in the same page with Html code between scripting tags. So Each time when there is a request for page it compiles the code each time then server the page Like c...

  • Difference between DataList and Repeater?ans:Both are similar,except for a difference that Repeater datas can't be edited whereas datalist datas can be edited

    samiksc

    • Jul 17th, 2007

    The differences are1. Repeater is generally used as a read-only forward-only control displaying data items one by one. DataList is used as a read-write control displaying one row of data at a time. Re...