473,473 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Calling one sub from another

Hello,

I have an image button that calls the sub "Image_Click". This in turn call
the sub "Submit_Click". I am getting the error:
Argument not specified for parameter 'E' of 'Public Sub Submit_Click(sender
As Object, E As System.EventArgs)

What and why do parameters need to be sent with this sub, when it works with
others?

Thanks in advance...

<asp:ImageButton runat="server"
ImageURL="go.jpg"
ImageAlign="Middle"
AlternateText="MyButton"
OnCommand="Image_Click"
CommandName="ASPNET"/></td>
Sub Image_Click (Src As Object, Args As CommandEventArgs)
Submit_Click
End Sub

Sub Submit_Click(sender As Object, E As EventArgs)
Response.Write("Hello World<br>")
End Sub
Nov 18 '05 #1
1 1376
Any Method which takes a parameter must have that parameter passed to it. An
Event Handler has the correct parameters passed to it by the object which
raised the event. In your case, you're not passing any parameters to a
method that takes 2 of them.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Steven K" <sk****@troop.com> wrote in message
news:OH**************@TK2MSFTNGP09.phx.gbl...
Hello,

I have an image button that calls the sub "Image_Click". This in turn call the sub "Submit_Click". I am getting the error:
Argument not specified for parameter 'E' of 'Public Sub Submit_Click(sender As Object, E As System.EventArgs)

What and why do parameters need to be sent with this sub, when it works with others?

Thanks in advance...

<asp:ImageButton runat="server"
ImageURL="go.jpg"
ImageAlign="Middle"
AlternateText="MyButton"
OnCommand="Image_Click"
CommandName="ASPNET"/></td>
Sub Image_Click (Src As Object, Args As CommandEventArgs)
Submit_Click
End Sub

Sub Submit_Click(sender As Object, E As EventArgs)
Response.Write("Hello World<br>")
End Sub

Nov 18 '05 #2

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

Similar topics

12
by: bhennon | last post by:
Hey all, I have a small php script that calls a random image at the following page. http://www.2006ymcanationals.com/random.php IT WORKS IF I go directly to the above link. I am trying to...
14
by: Michael Winter | last post by:
In an attempt to answer another question in this group, I've had to resort to calling the DOM method, Node.removeChild(), using a reference to it (long story...). That is, passing Node.removeChild....
5
by: Chris | last post by:
Hi I have a scenario where I've created another AppDomain to dynamically load a DLL(s) into. In this newly loaded DLL I want to call a static method on a class. The problem arise is that I have...
18
by: Simula | last post by:
I am developing an HTML javascript application and I want to preserve state in a way that can be book-marked. I chose HTML anchors as a means of preserving state. When the application changes...
15
by: Bryan | last post by:
I have a multi-threaded C# console application that uses WMI (System.Management namespace) to make RPC calls to several servers (600+ ) and returns ScheduledJobs. The section of my code that...
17
by: Bill Grigg | last post by:
I have been successfully calling DLL's using VC++ 6.0 and also using VC++7.1 (.NET). I only mention this because I have never felt comfortable with the process, but nonetheless it did work....
5
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS...
11
by: briankirkpatrick | last post by:
Forgive me if my post seems a little amateurish... I'm requesting assistance from some of you smart folks out there to get the managed calls write that meet the specification in the esa.h for...
7
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
I have a C# logging assembly with a static constructor and methods that is called from another C# Assembly that is used as a COM interface for a VB6 Application. Ideally I need to build a file...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.