Dynamically set OnSelectedIndexChanged for DDL

J

Jon Maz

Hi,

I have a user control which contains a DropDownList, and I want to be able
to set the OnSelectedIndexChanged method of the DDL in the User Control from
the holding aspx page.

Depending on which aspx page is holding the user control, the name of the
method to be called when this event fires is different, so I want to pass
the name of the method to the DDL via a public property of the User Control.

I'm struggling to do this; I have tried the following:

Public Property OnSelectedIndexChanged as System.EventArgs
Get
'sth here
End Get
Set
AddHandler ddlItems.SelectedIndexChanged, AddressOf value
End Set
End Property

....but this just gets the following error message:

error BC30577: 'AddressOf' operand must be the name of a method; no
parentheses are needed

Any ideas on how to get this to work?

TIA

JON


PS Posted to microsoft.public.dotnet.framework.aspnet.webcontrols two
days ago - no answers yet.
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top