Author: bgs264 | Posted on: 1/16/2009 7:28:24 AM | Views : 366

Greetings,

I have a repeater, bound to a list of items. There are a couple of text boxes (each with a RequiredFieldValidator) and a dropdownlist inside the ItemTemplate. I have the "OnSelectedIndexChanged" event of the dropdownlist wired up to a sub in code-behind (of course I set AutoPostBack = true), such that if the dropdownlist changes to a certain value, one of the fields should become optional.

To implement this, in the event that handles the SelectedIndexChanged of the dropdown list, I do
Dim ddl As DropDownList = DirectCast(sender, DropDownList)
Dim ri As RepeaterItem = DirectCast(DirectCast(sender, DropDownList).Parent, RepeaterItem)


To get a reference to the RepeaterItem. I then use ri.FindControl("rqvMyValidator") to ...

Go to the complete details ...