If I could just add something that might be helpful (not contradicting, because BB's explanation is certainly correct).
Those arguments are more useful in other EventHandlers, such as those for ButtonClicks or the like, and here's why:
You can have three buttons that have the same event handler. Using the 'sender' argument, you can figure out which of the buttons were clicked.
((Button)sender).ID //for example
As for the EventArgs argument, it often times has useful information about the event, as well.
For instance, CommandEventArgs has a property called .CommandName, and another called .CommandArgument
So, you could assign the three buttons to all call on the same EventHandler. The three buttons, though, obviously have different actions that should be called. One is an Add button, another is a Delete button, and the third is a Modify button, so your button might look like this:
<asp:Button CommandName=Add id=btnAdd OnCommand="HandleCommand" Runat=Server>Add</asp:Button>
So your EventHandler might look like this:
protected void HandleCommand(object o, CommandEventArgs e)
{
switch(e.CommandName.ToString().ToLower())
{
case "add":
AddSomething();
break;
case "modify":
ModifySomething();
break;
case "delete":
DeleteSomething();
break;
}//switch
}
Where AddSomething(), ModifySomething(), & DeleteSomething() are all methods in your class that do their respective tasks.
You can even add a .CommandArgument so that you know WHAT to add, modify or delete:
<asp:Button CommandName=Add CommandArgument="Car" id=btnAdd OnCommand="HandleCommand" Runat=Server>Add</asp:Button>
so then, you can send that argument along, as well:
protected void HandleCommand(object o, CommandEventArgs e)
{
string cmdArg = e.CommandArgument.ToString().ToLower();
switch(e.CommandName.ToString().ToLower())
{
case "add":
AddSomething(cmdArg);
break;
case "modify":
ModifySomething(cmdArg);
break;
case "delete":
DeleteSomething(cmdArg);
break;
}//switch
}
So now, you're not only telling the AddSomething method to add SOMETHING, but you're telling it to add a 'CAR'.
You can see how this has the potential to greatly reduce the amount of code that must be written. It adds a great amount of flexibility so that you can reuse the same methods for lots of different things.
Quite honestly, you probably won't use those arguments very much in your fledgling days as a .NET developer (a fully functional application could be written w/o ever using them), but as your skills increase (along with the complexity of your projects), you will make more and more use of them.
Hope that clears things more than it muddies.

-paul
The answer to getting answered -- faq855-2992