Re: [問題] VS2005中GridView元件的問題
※ 引述《mygod1220 (晴天)》之銘言:
: 我想要建立一個討論區的頁面
: 其中GridView有兩個欄位是ImageField
: 分別用來表示新文章(new),還有熱門文章(hot)的圖案
: 我必須讓這兩個欄位在滿足一定條件之後才顯示對應的圖案
: 程式碼如下
: 感謝回應
: <Columns>
: <asp:BoundField DataField="name" HeaderText="標題"
: ReadOnly="True" SortExpression="name" />
: <asp:ImageField DataImageUrlField="picture"
: NullImageUrl="~/images/new.gif" ReadOnly="True">
<asp:ImageField ...... Visible = '<%# ((DateTime)Eval("poDate")).CompareTo
(DateTime.Today) > 0 ? True : False %#>' ...... />
: </asp:ImageField>
: 這個地方我該如何撰寫判斷式poDate >= dateTime.today
: ,並回傳結果給Visable屬性,控制圖樣顯示呢?
: <asp:ImageField DataImageUrlField="picture"
: NullImageUrl="~/images/hot.gif" ReadOnly="True">
: </asp:ImageField>
: <asp:BoundField DataField="putOut" HeaderText="作者"
: ReadOnly="True" SortExpression="putOut" />
: <asp:BoundField DataField="poDate" HeaderText="時間"
: ReadOnly="True" SortExpression="poDate" />
: <asp:BoundField DataField="clickTimes" HeaderText="熱
: 門指數" ReadOnly="True" SortExpression="clickTimes" />
: <asp:BoundField DataField="replyTimes" HeaderText="回
: 應篇數" ReadOnly="True" SortExpression="replyTimes" />
: </Columns>
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.73.242.90
討論串 (同標題文章)
C_Sharp 近期熱門文章
PTT數位生活區 即時熱門文章