2011-06-01 51 views
0

嗨,大家好可有人請asist..my代碼如下:問題HeaderTemplate中的asp:直放站

按鈕單擊事件的圖像不會被解僱,但只要我把它拿出來的頭部模板事件被解僱..請幫助我解決這個問題!

謝謝!

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ResultsControl.ascx.cs" 
Inherits="POS.Web.Campaign.Controls.ResultsControl" %> 

<div id="divResultsMain"> 
     <br /> 
     <asp:Repeater ID="repeaterCampaignList" runat="server" > 
      <HeaderTemplate> 
       <table cellspacing="0" cellpadding="0"> 
        <tr class="repeaterAlternatingItem"> 
         <th> 
          <asp:ImageButton ID="campNameAsc" runat="server" ImageUrl="~/images/up-arrow.jpg" 
           Height="20px" Width="20" OnClick="campNameAsc_Click" /> 
          <asp:ImageButton ID="campNameDesc" runat="server" ImageUrl="~/images/down-arrow.jpg" 
           Height="20px" Width="20" OnClick="campNameDesc_Click" CausesValidation="False" />Campaign 
          Name 
         </th> 
         <th> 
          <asp:ImageButton ID="campIDAsc" runat="server" ImageUrl="~/images/up-arrow.jpg" Height="20px" 
           Width="20" OnClick="campIDAsc_Click" /> 
          <asp:ImageButton ID="campIDDesc" runat="server" ImageUrl="~/images/down-arrow.jpg" 
           Height="20px" Width="20" OnClick="campIDDesc_Click" />Campaign ID 
         </th> 
         <th> 
          <asp:ImageButton ID="campTypeAsc" runat="server" ImageUrl="~/images/up-arrow.jpg" 
           Height="20px" Width="20px" OnClick="campTypeAsc_Click" /> 
          <asp:ImageButton ID="campTypeDesc" runat="server" ImageUrl="~/images/down-arrow.jpg" 
           Height="20px" Width="20" OnClick="campTypeDesc_Click" /> 
          Campaign Type 
         </th> 
         <th style="width:43px"> 
         <asp:ImageButton ID="VIPAsc" runat="server" ImageUrl="~/images/up-arrow.jpg" 
           Height="20px" Width="20" OnClick="campNameAsc_Click" ImageAlign="NotSet" /> 
          <asp:ImageButton ID="VIPDesc" runat="server" ImageUrl="~/images/down-arrow.jpg" 
           Height="20px" Width="20" OnClick="campNameDesc_Click" CausesValidation="False" /> 
          VIP 
         </th> 
         <th> 
         <asp:ImageButton ID="countryAsc" runat="server" ImageUrl="~/images/up-arrow.jpg" 
           Height="20px" Width="20" OnClick="campNameAsc_Click"/> 
          <asp:ImageButton ID="countryDesc" runat="server" ImageUrl="~/images/down-arrow.jpg" 
           Height="20px" Width="20" OnClick="campNameDesc_Click" CausesValidation="False" /> 
          Country 
         </th> 
         <th> 
         <asp:ImageButton ID="brandAsc" runat="server" ImageUrl="~/images/up-arrow.jpg" 
           Height="20px" Width="20" OnClick="campNameAsc_Click" /> 
          <asp:ImageButton ID="brandDesc" runat="server" ImageUrl="~/images/down-arrow.jpg" 
           Height="20px" Width="20" OnClick="campNameDesc_Click" CausesValidation="False" /> 
          Brand 
         </th> 
         <th> 
         <asp:ImageButton ID="activeAsc" runat="server" ImageUrl="~/images/up-arrow.jpg" 
           Height="20px" Width="20" OnClick="activeAsc_Click" /> 
          <asp:ImageButton ID="activeDesc" runat="server" ImageUrl="~/images/down-arrow.jpg" 
           Height="20px" Width="20" OnClick="activeDesc_Click" CausesValidation="False" /> 
          Active 
         </th> 
         <th> 
          <asp:ImageButton ID="createdByAsc" runat="server" ImageUrl="~/images/up-arrow.jpg" 
           Height="20px" Width="20px" OnClick="createdByAsc_Click" /> 
          <asp:ImageButton ID="createdByDesc" runat="server" ImageUrl="~/images/down-arrow.jpg" 
           Height="20px" Width="20" OnClick="createdByDesc_Click" /> 
          Created By 
         </th> 
         <th> 
          <asp:ImageButton ID="campStartAsc" runat="server" ImageUrl="~/images/up-arrow.jpg" 
           Height="20px" Width="20px" OnClick="campStartAsc_Click" /> 
          <asp:ImageButton ID="campStartDesc" runat="server" ImageUrl="~/images/down-arrow.jpg" 
           Height="20px" Width="20" OnClick="campStartDesc_Click" /> 
          Campaign Start Date 
         </th> 
         <th> 
          <asp:ImageButton ID="campEndAsc" runat="server" ImageUrl="~/images/up-arrow.jpg" 
           Height="20px" Width="20px" OnClick="campEndAsc_Click" /> 
          <asp:ImageButton ID="campEndDesc" runat="server" ImageUrl="~/images/down-arrow.jpg" 
           Height="20px" Width="20" OnClick="campEndDesc_Click" /> 
          Campaign End Date 
         </th> 
        </tr> 
      </HeaderTemplate> 
      <ItemTemplate> 
       <tr class="repeaterItem"> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "StoreDescription")%> 
        </td> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "ID") %> 
        </td> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "CampaignType")%> 
        </td> 
        <td align="center"> 
         <asp:CheckBox runat="server" Enabled="false" Checked='<%#DataBinder.Eval(Container.DataItem, "IsVIP")%>' /> 
        </td> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "Country")%> 
        </td> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "Brand")%> 
        </td> 
        <td align="center"> 
         <asp:CheckBox ID="CheckBox1" Enabled="false" runat="server" Checked='<%#DataBinder.Eval(Container.DataItem, "IsActive")%>' /> 
        </td> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "Owner")%> 
        </td> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "CampaignStartDate", "{0 : dd MMMM yyyy}")%> 
        </td> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "CampaignEndDate", "{0 : dd MMMM yyyy}")%> 
        </td> 
       </tr> 
      </ItemTemplate> 
      <AlternatingItemTemplate> 
       <tr class="repeaterAlternatingItem"> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "StoreDescription")%> 
        </td> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "ID") %> 
        </td> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "CampaignType")%> 
        </td> 
        <td align="center"> 
         <asp:CheckBox Enabled="false" runat="server" Checked='<%#DataBinder.Eval(Container.DataItem, "IsVIP")%>' /> 
        </td> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "Country")%> 
        </td> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "Brand")%> 
        </td> 
        <td align="center"> 
         <asp:CheckBox ID="CheckBox1" Enabled="false" runat="server" Checked='<%#DataBinder.Eval(Container.DataItem, "IsActive")%>' /> 
        </td> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "Owner")%> 
        </td> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "CampaignStartDate","{0 : dd MMMM yyyy}")%> 
        </td> 
        <td> 
         <%#DataBinder.Eval(Container.DataItem, "CampaignEndDate", "{0 : dd MMMM yyyy}")%> 
        </td> 
       </tr> 
      </AlternatingItemTemplate> 
      <FooterTemplate> 
       </table> 
      </FooterTemplate> 
     </asp:Repeater> 
    </div> 
    <p> 
     &nbsp;<p> 
      <asp:Label ID="lblCurrentPage" runat="server"></asp:Label> 
     </p> 
     <asp:LinkButton ID="prev" runat="server" onclick="prev_Click">Prev</asp:LinkButton> 
     <asp:LinkButton ID="next" runat="server" onclick="next_Click">Next</asp:LinkButton> 
     <p> 
     </p> 
    </p> 
</ContentTemplate> 

回答

0

我認爲你需要處理你的中繼的ItemCommand。如果內存服務器控制嵌套在中繼器中,則不會引發事件