作者Solccp (斌斌)
看板Web_Design
標題Re: [問題] ASP.NET寫留言板的問題
時間Tue Feb 28 16:39:05 2006
※ 引述《del680202 (東葉月)》之銘言:
回傳的函式不能為void
因為他會轉型為 string
我寫的 (我用asp.net 1.1寫的)
in .aspx
<asp:Repeater id="Repeater1" runat="server">
<ItemTemplate>
<%# MyFun(Eval("FileName").ToString()) %><br />
</ItemTemplate>
</asp:Repeater>
in .aspx.cs
protected bool MyFun(string fn)
{
if (fn.EndsWith(".pdf"))
return true;
return false;
}
是可以執行的
你可以在試試看
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.127.224.57