Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Get the wrong sender in delegate

Reply
Thread Tools

Get the wrong sender in delegate

 
 
John Kattestaart
Guest
Posts: n/a
 
      04-06-2006
I'm trying to put two dynamic dropdownlists on form.
When i test the code, i get the wrong sender in my delegate.
Cannot figure out what i'm doing wrong...


Dim WithEvents ControlDropDownList As System.Web.UI.WebControls.DropDownList

Public Sub InitializeObject(ByVal parent As System.Web.UI.Control)

ControlDropDownList = New System.Web.UI.WebControls.DropDownList
ControlDropDownList.ID = "DropDown1"
parent.Controls.Add(ControlDropDownList)
ControlDropDownList.AutoPostBack = True
ControlDropDownList.EnableViewState = True
AddHandler ControlDropDownList.TextChanged, AddressOf
ControlDropDownList_TextChanged


ControlDropDownList.Width = New System.Web.UI.WebControls.Unit("200px")
ControlDropDownList.DataSource = Languages
ControlDropDownList.DataTextField = LanguageFields.Description.Name
'AccommodationFields.Description.Name
ControlDropDownList.DataValueField = LanguageFields.LanguageId.Name
'AccommodationFields.AccommodationId.Name
ControlDropDownList.DataBind()

ControlDropDownList = New System.Web.UI.WebControls.DropDownList
ControlDropDownList.ID = "DropDown2"
parent.Controls.Add(ControlDropDownList)
ControlDropDownList.AutoPostBack = True
ControlDropDownList.EnableViewState = True
AddHandler ControlDropDownList.TextChanged, AddressOf
ControlDropDownList_TextChanged


ControlDropDownList.Width = New System.Web.UI.WebControls.Unit("200px")
ControlDropDownList.DataSource = Locations
ControlDropDownList.DataTextField = LocationFields.Name.Name
'AccommodationFields.Description.Name
ControlDropDownList.DataValueField = LocationFields.LocationId.Name
'AccommodationFields.AccommodationId.Name
ControlDropDownList.DataBind()

End Sub


Protected Sub ControlDropDownList_TextChanged(ByVal sender As Object,
ByVal e As System.EventArgs)
Dim myText As String
myText = CType(sender, System.Web.UI.Control).ID
End Sub

End Class

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RTCP:Can a sender sender reception report blocks in an SR packet for recievers for which it hasn't recieved any RTP data? jon wayne VOIP 0 05-20-2006 12:23 PM
Re: fix a "sender" name in the "sender" field on email Dylan Parry HTML 2 03-19-2005 04:21 PM
Sender Virus-alert (sender: python-list@python.org) Antivirus-Daemon@mercurio.ulpgc.es Python 0 08-20-2003 04:35 PM
Sender Virus-alert (sender: python-list@python.org) Antivirus-Daemon@maciot.ulpgc.es Python 0 08-19-2003 12:40 PM
Why are sender and object used as in sender As System.Object, ByVal e As System.EventArgs? Showjumper ASP .Net 2 08-02-2003 10:53 PM



Advertisments