<%@ 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:datalist runat="server" ID="ds_searchresult" CssClass="table table-hover" 
    RepeatColumns="1"  
      DataSourceID="SqlDataSource1" RepeatDirection="Horizontal">
				 <ItemTemplate>
				 
 
		     
          【<%#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>
 
     
		 </ItemTemplate> 
			 
   </asp:DataList>

    
    
      
    
    
    
    
    
    
       <asp:SqlDataSource
        ConnectionString='<%$ ConnectionStrings:connectionstring %>'
        ID="SqlDataSource1" runat="server" 
         ProviderName="System.Data.SqlClient" 
        SelectCommand="SELECT  helpdesk_news.id,addby,istop, [catid],catname, [title], [createdate] FROM [helpdesk_news] left 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>
