473,385 Members | 1,925 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,385 software developers and data experts.

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 892
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.