时间:2021-07-01 10:21:17 帮助过:11人阅读
.aspx:
代码如下:
<asp:DataList ID="dlstCon" runat="server">
<ItemTemplate>
<li><a href='<%# "ShowList.aspx?ExhibitionID="+Eval("ExhibitionID") %>'
title='<%# IsMultiLang(Eval("Title"),Eval("TitleValue"))%>'> <%# Eval("Title") %></a></li>
</ItemTemplate>
</asp:DataList>
.cs:
代码如下:
protected string IsMultiLang(object pTitle, object pTitleValue)
{
string mReturn = "";
if (pTitleValue.ToString() != "Null" && pTitleValue.ToString() != "")
{
mReturn = pTitle.ToString() + "[" + pTitleValue.ToString() + "]";
}
else
{
mReturn = pTitle.ToString();
}
return mReturn;
}