<%@ Page Title="" Language="C#" MasterPageFile="~/helpdesk/News.master" AutoEventWireup="true" CodeBehind="News_list.aspx.cs" Inherits="helpdesk.helpdesk.News_list" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">

    <style>
        .grey {
         color:gray; font-size:11px;}
    </style>

    <h4>新闻列表</h4>
    
      
    
    
    
    
    <asp:ListView runat="server" ID="lv"
         DataSourceID="SqlDataSource1"  
        
        >
       
        <ItemTemplate>
       
            	 <tr>
                     <td>

                    
          【<%#Eval("catname") %>】 
             
            <a href='news_view.aspx?id=<%#Eval("id") %>' target="_blank" ><%#Eval("title") %></a> 
            
        <span class="commentsAttr grey"> ( <%# DateTime.Parse(Eval("createdate").ToString()).ToString("yyyy-MM-dd") %> ) </span>
 
            </td>
          </tr>   

        </ItemTemplate>
        <LayoutTemplate>

            <table   class="table table-hover"   >
 
             <tr runat="server" id="itemPlaceholder" /> 
             </tr> 
          
            </table>
        </LayoutTemplate>
        
    </asp:ListView>









<div>
 <asp:DataPager ID="DataPager1"   class="btn-group btn-group-sm" EnableViewState="false"
      QueryStringField="Page" PagedControlID="lv" runat="server" PageSize=10>
 <Fields>
           
     
            <asp:NextPreviousPagerField 
                PreviousPageText="<" 
                FirstPageText="|<" 
                ShowPreviousPageButton="true"
                ShowFirstPageButton="true" 
                ShowNextPageButton="false" 
                ShowLastPageButton="false"
                ButtonCssClass="btn btn-default" 
                RenderNonBreakingSpacesBetweenControls="false" 
                RenderDisabledButtonsAsLabels="false" />

            <asp:NumericPagerField 
                ButtonType="Link" 
                CurrentPageLabelCssClass="btn btn-primary disabled"  
                RenderNonBreakingSpacesBetweenControls="false"
                NumericButtonCssClass="btn btn-default" 
                ButtonCount="10" 
                NextPageText="..." 
                NextPreviousButtonCssClass="btn btn-default" />
            
           <asp:NextPreviousPagerField 
               NextPageText=">" 
               LastPageText=">|" 
               ShowNextPageButton="true"
               ShowLastPageButton="true" 
               ShowPreviousPageButton="false" 
               ShowFirstPageButton="false"
               ButtonCssClass="btn btn-default" 
               RenderNonBreakingSpacesBetweenControls="false" 
               RenderDisabledButtonsAsLabels="false"/>
      

  </Fields> 
</asp:DataPager>
</div>



    
    <asp:SqlDataSource
        ConnectionString='<%$ ConnectionStrings:connectionstring %>'
        ID="SqlDataSource1"
        runat="server" 
     
        SelectCommand="SELECT  helpdesk_news.id,addby,istop, [catid],catname, [title], [createdate] FROM [helpdesk_news] inner join helpdesk_newscat on helpdesk_news.catid=helpdesk_newscat.id  where ( (@catid=0) or(catid=@catid)) ORDER BY istop desc, [id] DESC " 
       >
       
      
       <SelectParameters>
              <asp:QueryStringParameter Name="catid" Type="Int32" DefaultValue="0" QueryStringField="catid" />
       </SelectParameters>
       
    </asp:SqlDataSource>
 

</asp:Content>
