473,326 Members | 2,095 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

eventargs?

rom
i want to call a sub in vb.net like:
Private Sub X(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.RepeaterItemEventArgs)

where the second argument can sometimes be
RepeaterCommandEventArgs or any other kind of this
eventargs thing......
is there a way that I can call the function by myself? i
can send as first parameter the object itself (repeater,
datagrid etc.) but what with the second??

Thanks!
Nov 18 '05 #1
2 1268
All event argument types derive from the System.EventArgs class. If you
define the second parameter as System.EventArgs you can then cast the e
parameter to the appropriate type based on the type of the sender parameter.

HTH

Alan

"rom" wrote:
i want to call a sub in vb.net like:
Private Sub X(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.RepeaterItemEventArgs)

where the second argument can sometimes be
RepeaterCommandEventArgs or any other kind of this
eventargs thing......
is there a way that I can call the function by myself? i
can send as first parameter the object itself (repeater,
datagrid etc.) but what with the second??

Thanks!

Nov 18 '05 #2
It sounds like you're wanting to acll an Event Handler for something other
than handling an event. While this is possible (set the EventArgs argument
to null), it is generally a sign that your code needs to be revised. If you
want to execute the same code in the Event Handler, you'd probably be best
off putting the code into another function that the Event Handler can call
as well as other entities.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Neither a follower
nor a lender be.

"rom" <me****@ifat.com> wrote in message
news:20****************************@phx.gbl...
i want to call a sub in vb.net like:
Private Sub X(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.RepeaterItemEventArgs)

where the second argument can sometimes be
RepeaterCommandEventArgs or any other kind of this
eventargs thing......
is there a way that I can call the function by myself? i
can send as first parameter the object itself (repeater,
datagrid etc.) but what with the second??

Thanks!

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Steve Amey | last post by:
Hi all I am creating a basic control to perform some tasks, and I want to declare some events to be raised so they can be handled from the form that the control is on. I can create my own Event...
2
by: ZAky | last post by:
Why do I get a System.NullReferenceException for this script? I added the following script to a simple form with a button. <Script> public event EventHandler DoThis; static void Main() {...
8
by: Phill | last post by:
All the event handlers seem to pass an Object and an EventArgs object. If the event doesn't need this info why pass them anyway? It is inefficient.
1
by: Jack Addington | last post by:
I have a 3rd party object that fires an itemchanged event when someone edits some data on a form. This event has a custom eventArgs that has a field called ActionCode. In the code of the event,...
3
by: Amil | last post by:
when i double-click on a button on a form as i am designing the form, the IDE creates a method corresponding to a event assignment as follows: this eventhandler: this.exitToolStripMenuItem.Click...
3
by: Yangtsi River | last post by:
Hi, in any event procudure,there is two paras:sender As Object, e As EventArgs, i copied them-not know what they are about, and my ASPX works. I guess the sender is the control by which I...
3
by: Leslie Sanford | last post by:
I have a hierarchy of message classes. Many times when messages are created/received by a class, an event is generated to let the outside know. Also, the message is passed along when raising the...
2
by: Bob | last post by:
Hi, I'm still new to asp.net and i would like to understand this: "Source As Object, e As EventArgs" <script runat="server"> Sub button1(Source As Object, e As EventArgs) p1.InnerHtml="You...
4
by: Frankie | last post by:
The .NET Framework provides us with built-in event handlers: System.EventHandler and the generic System.EventArgs<TEventArgs> It appears that those built-in event handler delegates are just a...
3
by: Tony | last post by:
Hello! One more thing assume I create an event and an object derived from the eventArgs containing some info about the event. Then create another event also with an object derived from the...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.