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

M

mj.redfox.mj

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("relAssigneeGroups")%>'
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("relAssigneeGroups")%>'
OnItemDataBound="Test_Sub(****, ****, myval1, myval2)">

VB PAGE
 
B

bruce barker

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)
 
M

mj.redfox.mj

Thanks Bruce, I think I need to try a different approach with my code
on this one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top