K
Kristian Kaadner
Hi.
I use asp.net 2.0 adn add data to a listbox dynamically like this:
Dim lb as listbox
lb = formview1.FindControl("ListBox1")
lb.DataSourceID = "sqlDataSource1"
lb.DataTextField = "Name"
lb.DataValueField = "ID"
lb.DataBind()
But I use a requiredfieldvalidator on ListBox1, and when the data is added
dynamically, it fires when I submit the page, giving me the error message I
defined. If I add data to my listbox in another way, for example by selected
a value in a dropdownlist, the requiredfieldvalidator works.
How can I get get around this?
Best regards
Kris
I use asp.net 2.0 adn add data to a listbox dynamically like this:
Dim lb as listbox
lb = formview1.FindControl("ListBox1")
lb.DataSourceID = "sqlDataSource1"
lb.DataTextField = "Name"
lb.DataValueField = "ID"
lb.DataBind()
But I use a requiredfieldvalidator on ListBox1, and when the data is added
dynamically, it fires when I submit the page, giving me the error message I
defined. If I add data to my listbox in another way, for example by selected
a value in a dropdownlist, the requiredfieldvalidator works.
How can I get get around this?
Best regards
Kris