Click here to Skip to main content
15,888,293 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


public partial class Search : System.Web.UI.Page
{

      
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}


What is the use of object sender, EventArgs e in the code above?
Thanks in advance.
Posted
Updated 21-Apr-21 9:11am
v2

Page_Load is an event handler. It basically tells what should happen if a page is loaded. sender is what caused this event and e contains information about the event. For instance, if you drop a ball from certain height,

event: you dropping the ball
sender: you
e: information about the event. Something like from which height you dropped the ball.
 
Share this answer
 
Basicly the Page_Load function is an event handler. The sender is the event raising object, and the e variable is the event arguments. Take a look into the following subjects:
Handling and Raising Events[^][^]
Delegates (C# Programming Guide)[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900