add events to dropdown list in custom server control

T

ton

Hi,
It is easy to add an event to a hyperbutton, but what about a dropdownlist ?

This is what I've implemented for the hyperbutton:
lblHyper.CommandName = "H" & i

lblHyper.CommandArgument = "Test"

AddHandler lblHyper.Click, AddressOf Me.ButtonClick

Now I want to have a kind of event like a lostfocus or changed event on the
dropdownlist

is that possible ?

Ton
 
A

Alessandro Zifiglio

simply do what you did with your button, and do not forget to set the
autopsotback to true for your dropdownlist. If you rem, a dropdownlist can
postback and therefore raise a postback event like your button when an item
is selected ;P
dropdownlist1.AutoPostBack = True
 
T

ton

but what event can be used for the dropdownlist

cmbField.SelectedIndexChanged like

AddHandler cmbField.SelectedIndexChanged, AddressOf Me.BasicBrowse



in basicbrowse I just show something like

Private Sub basicBrowse(ByVal sender As Object, ByVal e As System.EventArgs)

context.Response.Write("the event ")

End Sub
 

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,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top