Solved

parameters on page_unload

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 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

16 Experts available now in Live!

Get 1:1 Help Now