日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

DataList的使用及一些參數(shù)_4C網(wǎng)絡(luò)

 知足常樂WQL 2007-11-21
DataList的使用及一些參數(shù)
2006年12月24日 星期日 12:20

如果你不滿足于系統(tǒng)提供的幾種列表方式,可以設(shè)置列表方式為“DataList綁定”,然后修改分類模板template/list1.aspx中的DataList控件。

默認(rèn)DataList控件如下:

  <asp:DataList id="dlNews"
  CellPadding="5"
  CellSpacing="0"
  GridLines="None"
  RepeatColumns="3"
  RepeatDirection="Horizontal"
  RepeatLayout="Table"
  Visible=false
  Width="100%"
  runat="server">
  <ItemStyle CssClass="alignCenterTop"/>
  <ItemTemplate>
   <%#LinkImg((System.Data.DataRowView)Container.DataItem)%>
   <%#LinkTitle((System.Data.DataRowView)Container.DataItem)%>
  </ItemTemplate>
  </asp:DataList>

DataList控件使用方法詳見:http://msdn2.microsoft.com/zh-CN/library/9cx2f3ks.aspx

如果你裝有.net framework sdk文檔請看:ms-help://MS.NETFrameworkSDKv1.1.CHS/cpgenref/html/cpconDataListWebServerControl.htm

ItemTempate中如何顯示新聞信息:

新聞標(biāo)題(帶鏈接): <%#LinkTitle((System.Data.DataRowView)Container.DataItem,40)%>
(其中40為標(biāo)題長度,可修改)

標(biāo)題圖片(帶鏈接): <%#LinkImg((System.Data.DataRowView)Container.DataItem)%>

新聞日期: <%#FormatTime((DateTime)DataBinder.Eval(Container.DataItem,"dateandtime"))%>

新聞簡介: <%#DataBinder.Eval(Container.DataItem,"summary")==DBNull.Value ? IWMS.Utility.WbText.NoHtml((string)DataBinder.Eval(Container.DataItem,"content")): IWMS.Utility.WbText.UrlAddPrefix((string)DataBinder.Eval(Container.DataItem,"summary"),urlPrefix)%>

新聞URL: <%#DataBinder.Eval(Container.DataItem,"aurl")==DBNull.Value ? GetUrlNews((int)DataBinder.Eval(Container.DataItem,"articleid"),(int)DataBinder.Eval(Container.DataItem,"classid"),(DateTime)DataBinder.Eval(Container.DataItem,"dateandtime")): urlPrefix+"trans.aspx?id="+DataBinder.Eval(Container.DataItem,"articleid")%>

 

 

 

 

RepeatDirection="Horizontal"改為  RepeatDirection="Vertical",新聞可以按垂直順序排列.

  GridLines="None"改為  GridLines="1",每行新聞中間有一條橫線分割 

 GridLines="2"每列新聞之間有一條豎線分割

  RepeatColumns="3"表示分幾列顯示

  CellPadding="5"   CellSpacing="0"都是表格顯示參數(shù)

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多