<HeaderTemplate>
<TABLE cellSpacing="0" cellPadding="0" border="0" id="viewTable" width="100%">
<TBODY style="width:100%">
<TR class="repeaterHeadRow">
<TD colSpan="2">扣分点</TD>
<td style="cursor:hand;"  onmouseover="this.style.color='red';" onmouseout="this.style.color='black';" ondblclick="Getsort('Ncount');">
数量<ASP:ImageButton ImageUrl="../images/shengxu.gif" runat="server" ID="imageBtn"></ASP:ImageButton>
</td>
<TD>单位列表</TD>
</TR>
</HeaderTemplate>在后台怎么取得这个<ASP:ImageButton 控件?

解决方案 »

  1.   

    try:
    for ( int i = 0 ; i < Repeater1.Controls.Count ; i++ )
            {
                ImageButton imgButton = Repeater1.Controls[i].FindControl( "imageBtn" ) as ImageButton;
                if ( imgButton != null )
                {
                    imgButton.ImageUrl = "http://community.csdn.net/expert/images/rank/user1.gif";
                    break;
                }
            }
      

  2.   

    ImageButton imgButton = Repeater1.Controls[i].FindControl( "imageBtn" )
      

  3.   

    FindControl就可以了
    不难的
      

  4.   

    明明有控件,可是Response.Write(MarkingReduce.Controls.Count);却为0