后台控制前台控件属性
<asp:DataList ID="DataList1" runat="server" RepeatColumns="4" ShowFooter="False"
ShowHeader="False" Height="296px" Width="536px" RepeatDirection="Horizontal">
<ItemTemplate>
<div id="pic" runat="server">
<a href = "<%#"Picture_show.aspx?id="+Eval("id").toString() %>" >
<asp:Image ID="Image1" runat="server" ImageUrl='<%#"Upload/papers/S_image/"+Eval("p4") %>' />
</a>
<br />
<asp:Image ID="no" runat="server" ImageUrl="images/x1.jpg" Visible ="false"/>
<asp:Image ID="yes" runat="server" ImageUrl="images/x2.jpg" Visible ="false"/>
<asp:Label ID="imageid" runat="server" Text='<%#Eval("id") %>'></asp:Label>
</div>
</ItemTemplate>
<EditItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<SeparatorStyle CssClass=" " HorizontalAlign="Center" VerticalAlign="Middle" />
</asp:DataList>
我想后台控制datalist里面的ID为no和yes的image控件,后台直接写不行,使用findcontrol方法也试过了。。。。求助,谢谢各位了
[解决办法]
用委托方式吧