Solved

parameters on page_unload

Posted on 2004-08-23
1
626 Views
Last Modified: 2006-11-17
This should be a really easy one.  Some of the references I have seen say to write page unload as:

sub page_unload(sender as Object, e as EventArgs)

and others as:

sub page_unload()

am I correct in assuming that either one will work correctly?  I just want to make sure.  Thanks a lot,

--Adam

0
Comment
Question by:ARACK04
1 Comment
 
LVL 8

Accepted Solution

by:
shovavnik earned 100 total points
ID: 11879481
You should use the first one.  I'm not sure the second will work.

Keep in mind that this is an event handler.  That is, when the page unloads, asp.net throws a Page_Unload event to which you can hook a handler.

When you hook to that handler, you need to match the delegate of that event.

The first method uses the EventArgs parameter to pass the event data and the sender object to tell you who threw the event.

The second method (without the parameters) is probably just used as a short form on forums because nobody want to write out the whole function definition (signature) in a simple forum.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question