473,398 Members | 2,212 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,398 software developers and data experts.

Passing subroutine 'Sender' and 'e' (EventArgs) manually?

Hi,

Pretty basic question, apologies but being a bit of a newbie I still
don't know the answer to this kind of thing!
I have a repeater which, upon databind calls a subroutine, as below:

ASPX PAGE
-------------------
<asp:Repeater ID="repAssigneeGroups" runat="server" DataSource='<
%#Container.DataItem.Row.GetChildRows("relAssignee Groups")%>'
OnItemDataBound="Test_Sub">

And the subroutine is as below:

VB PAGE
---------------
Public Sub Test_Sub(ByVal Sender As Object, ByVal e As
RepeaterItemEventArgs)
Now this all works fine, as Sender and e are passed automatically.
However, in addition to these, I also need to pass a couple of my own
variables. The problem is that as soon as I start passing anything in,
it expects me to MANUALLY pass Sender and the event args as well, and
I'm afraid I have no idea how to do this. So basically all I'm asking
is how do I generate and pass the repeater 'sender' and 'eventargs'
information manually. Can anyone help at all?

Just to summarise, this is what I need to do (asterisks for the parts
I'm missing):

ASPX PAGE
-------------------
<asp:Repeater ID="repAssigneeGroups" runat="server" DataSource='<
%#Container.DataItem.Row.GetChildRows("relAssignee Groups")%>'
OnItemDataBound="Test_Sub(****, ****, myval1, myval2)">

VB PAGE
---------------
Public Sub Test_Sub(ByVal Sender As Object, ByVal e As
RepeaterItemEventArgs, ByVal myval1 as integer, ByVal myval2 as
integer)

Feb 19 '07 #1
2 2640
OnItemDataBound is a delegate, you can not change its signature
(parameter list). if you want it different you need to define a new
delegate. you would do this by creating a new repeater (inherit from
repeater), and create a new delegate.

also as OnItemDataBound is a delegate, it wants a delegate (routine
name), not a method with parameters.

-- bruce (sqlwork.com)

mj**********@gmail.com wrote:
Hi,

Pretty basic question, apologies but being a bit of a newbie I still
don't know the answer to this kind of thing!
I have a repeater which, upon databind calls a subroutine, as below:

ASPX PAGE
-------------------
<asp:Repeater ID="repAssigneeGroups" runat="server" DataSource='<
%#Container.DataItem.Row.GetChildRows("relAssignee Groups")%>'
OnItemDataBound="Test_Sub">

And the subroutine is as below:

VB PAGE
---------------
Public Sub Test_Sub(ByVal Sender As Object, ByVal e As
RepeaterItemEventArgs)
Now this all works fine, as Sender and e are passed automatically.
However, in addition to these, I also need to pass a couple of my own
variables. The problem is that as soon as I start passing anything in,
it expects me to MANUALLY pass Sender and the event args as well, and
I'm afraid I have no idea how to do this. So basically all I'm asking
is how do I generate and pass the repeater 'sender' and 'eventargs'
information manually. Can anyone help at all?

Just to summarise, this is what I need to do (asterisks for the parts
I'm missing):

ASPX PAGE
-------------------
<asp:Repeater ID="repAssigneeGroups" runat="server" DataSource='<
%#Container.DataItem.Row.GetChildRows("relAssignee Groups")%>'
OnItemDataBound="Test_Sub(****, ****, myval1, myval2)">

VB PAGE
---------------
Public Sub Test_Sub(ByVal Sender As Object, ByVal e As
RepeaterItemEventArgs, ByVal myval1 as integer, ByVal myval2 as
integer)
Feb 19 '07 #2
Thanks Bruce, I think I need to try a different approach with my code
on this one.

Feb 20 '07 #3

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

Similar topics

7
by: OutdoorGuy | last post by:
Greetings, I'm still relatively new to C# and was wondering if there was a way to exit a subroutine (such as "Exit Sub" in VB)? I have the code below which performs validations. If the user...
8
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
6
by: Scott Zabolotzky | last post by:
I'm trying to pass a custom object back and forth between forms. This custom object is pulled into the app using an external reference to an assembly DLL that was given to me by a co-worker. A...
7
by: Richard Grant | last post by:
Hi. In c/C++ i can pass the address of a subroutine to another subroutine as an actual parameter How do I do that in VB .NET What should be the syntax for a parameter to receive the address of a...
4
by: Jason Taylor | last post by:
Hello, I have created a Web service with the following web method; <WebMethod()> _ Public Function HelloWorld(ByVal myMemoryStream As System.IO.MemoryStream) As String Return "Hello World"...
7
by: AMP | last post by:
Hello, I have this in form1: namespace Pass { public partial class Form1 : Form { public Form2 form2; public Form1() {
2
by: qtlib | last post by:
How to pass data between two forms? I find in the Internet, but not found immplementation problem in Visual Studio 2005 and C++ language. Example: I have a 2 forms: Form1 and Form2. On a...
2
by: darthghandi | last post by:
I am trying to pass a socket object when an event is signaled. I have successfully bound to a network interface and listened on a port for incoming connection. I have also been able to accept...
2
by: Alcestis | last post by:
I understand that if i call a subroutine from a control the subroutine refers to the control that called it using sender. What i don't understand however is how exactly to implement this... Say...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.