Solved

parameters on page_unload

Posted on 2004-08-23
1
614 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now