我在aspx頁面下面的代碼Asp.NET font-size和服務功能
<asp:Label ID="CittaLabel" runat="server" Text='<%# Eval("Citta") %>' Font-Size='<%# ReturnFontSize(Eval("Big")) %>'/>
,這背後是服務功能
Protected Function ReturnFontSize(ByVal Big As Boolean) As FontUnit
If Big Then
ReturnFontSize = FontSize.Medium
Else
ReturnFontSize = FontSize.Small
End If
End Function
我的代碼,但我得到一個總字體非常小。 所以我的問題是:爲了改變一個控件的「字體大小」proprety,從後面的代碼,我必須使用哪種返回類型,假設FontUnit不起作用?
謝謝
我在一個列表視圖,所以我更喜歡避免在使用的ItemDataBound – stighy 2010-06-22 12:39:53
PS:也返回字號類型的頁面渲染尺寸較小的字體(7PT) – stighy 2010-06-22 12:40:53
FontSize.Medium是7PT ;-) 你有你的數據綁定列表視圖。 – 2010-06-22 12:44:12