Solved

Raising a click event programmatically

Posted on 2003-12-08
2
440 Views
Last Modified: 2007-12-19
I have an imagebutton:

cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs)

How do I raise it's click event within the code behind, specifically, what are the parameters to pass
0
Comment
Question by:tyy8
2 Comments
 
LVL 1

Expert Comment

by:Yarx
ID: 9899536
Well, the sender is whatever triggered the event. But in your case. Most people just pass in the "Me" keyword. As for the event erguments, just use "System.Web.UI.ImageClickEventArgs.Empty" Since you aren't doing anything fancy.

So it would look something like this from within your code.

cmdSubmit_Click(Me, ImageClickEventArgs.Empty)
0
 
LVL 8

Accepted Solution

by:
Dranizz earned 50 total points
ID: 9899541
sender is the object that called the event, then you can put the control object of your button to that parameter. the other is generated

If you want to call that event, and don't use the parameters in the sub of the event then call it this way
cmdSubmit_Click(nothing,nothing)

or
cmdSubmit_Click(cmdSubmit,nothing)

or
  Dim arg As New System.Web.UI.ImageClickEventArgs(10, 20) 'Wich are the position of the mouse when it cliked the button

cmdSubmit_Click(cmdsubmit,arg)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 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

18 Experts available now in Live!

Get 1:1 Help Now