Reply to topic
Finding DropDownList in Repeater
jeffc7272


Joined: 13 May 2006
Posts: 5
Reply with quote
Hello,

I'm trying to figure out how to change the visibility state of a DropDownList server control that is inside a repeater. The visibility would be based on a condition of one of the DataItems. I'm using DataBinder.Eval to call the function to check the condition. The problem I'm running into is how to access the DropDownList control inside of the repeater. I've searched and searched but this aspx rookie can't find the solution! I'm sure it is simple. So what I have so far is:

Inside the repeater:

<%#generateDropDown(DataBinder.Eval(Container.DataItem, "Options").ToString())%>

And the function:

Public Function generateDropDown (ByVal checkOptions As String) As String
**MISSING CODE HERE TO DEFINE ddlOptions AS THE DROPDOWNLIST CONTROL**
If checkOptions = "yes" Then
ddlOptions.Visible = True
Else
ddlOptions.Visible = False
End If
Return checkOptions
End Function

Anyone know how this is done? Perhaps there's a better way to do it too.

Any help is greatly appreciated,
Jeff
Finding DropDownList in Repeater
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic