Problem:

Develop a page to demonstrate various events which are raised and handled during the ASP.NET Page Processing once the page object has been created.

Solution:

I have a created a dummy page in which break-points were used to debug the sequence of the events that occured during the processing of the page.
The sequence of events were as follow:

  1. Init
  2. Load
  3. Button Click
  4. Pre-Render
  5. Unload

Following is the code for the Website used in demonstration.

Default.aspx:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <p>This is the page used for task 01 of lab 04 to demonstrate <br/>
        different events that araises during the Page Processing.
    </p>
    <form id="form1" runat="server">
        <div>
            <asp:Button ID="Button1" runat="server" Text="Button" />
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        </div>
    </form>
</body>
</html>
            
Default.aspx.vb:

Partial Class _Default
    Inherits System.Web.UI.Page


    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        TextBox1.Text = "Button Clicked!!!"
    End Sub

    Protected Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged

    End Sub

    Private Sub _Default_Init(sender As Object, e As EventArgs) Handles Me.Init

    End Sub

    Private Sub _Default_Load(sender As Object, e As EventArgs) Handles Me.Load

    End Sub

    Private Sub _Default_PreRender(sender As Object, e As EventArgs) Handles Me.PreRender

    End Sub

    Private Sub _Default_Unload(sender As Object, e As EventArgs) Handles Me.Unload

    End Sub
End Class

            
Web hosting by Somee.com