[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

parameters on page_unload

Posted on 2004-08-23
1
Medium Priority
?
641 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 8

Accepted Solution

by:
shovavnik earned 400 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

656 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