我有一个 Slider 类,它将创建一个具有默认值的滑块,我想在中继器中调用它,我正在尝试使用以下代码。
<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>
绑定后的代码
Slider testSlider11 = Repeater2.FindControl("testSlider3") as Slider;
testSlider11 = new Slider();
testSlider11.MinRange = "0";
testSlider11.MaxRange = "100";
谁能帮我找到解决方案?