Solved

Raising a click event programmatically

Posted on 2003-12-08
2
444 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
[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
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

738 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