1

I have a Slider class, which will create a slider with default values, and I want to call it inside a repeater, I was trying with following code.

  <asp:Repeater ID="Repeater2" runat="server">
 <HeaderTemplate><table><head><title>Test</title></head></HeaderTemplate>
 <ItemTemplate>
 <tr>
  <td>
  <%# DataBinder.Eval(Container, "DataItem.first")%>
    <cs:CriteriaBuilder runat="server" ID="CriteriaBuilder1" ClientIDMode="Static" />  
    <cs:Slider ID="testSlider3" runat="server" SliderID = "testSlider3" /> 
    </td>
 </tr>
 </body>
    </ItemTemplate>
    <FooterTemplate>
      </table>
    </FooterTemplate>

</asp:Repeater>

Code behind binding with

 Slider testSlider11 = Repeater2.FindControl("testSlider3") as Slider;
 testSlider11 = new Slider();
 testSlider11.MinRange = "0";
 testSlider11.MaxRange = "100";

Can anyone help me to find the solution?

Shafqat Masood
  • 2,532
  • 1
  • 17
  • 23
Diboliya
  • 1,124
  • 3
  • 15
  • 38
  • I think this is what you find http://stackoverflow.com/questions/1191034/server-controls-in-an-asp-net-repeater – SUN Jiangong Apr 26 '13 at 12:07
  • What exactly is the problem? Are you unable to retrieve the control? Does the control not reflect your changes? Also, is the code underneath _Code behind binding with_ inside of the repeater's `OnItemDatabound` event? – Shai Cohen Apr 26 '13 at 16:57

0 Answers0