我對asp.net仍然陌生。我有一些問題,我想問一下,我來自PHP和C++。asp datalist任何人都可以詳細解釋
第一個問題。在html或aspx中。如果我想編寫C#代碼,通常<%%>應該工作,但什麼是底部3
<% %>
<%@
<%# %>
的Container.DataItem來自數據源來自Datalist中之間的不同。
其次,代碼的底部給我錯誤。因此我想對此作出解釋。這在C++中似乎是合法的。錯誤無效的爭論?從MSDN評估和演示應該返回對象或字符串
<div class="newPanel">
<asp:DataList ID="DataList_News" runat="server" CssClass="newPanel">
<ItemTemplate>
<div class="news"></div>
<div id="news_space" runat="server" visible="<%# DisplaySpace(System.Web.UI.DataBinder.Eval(Container.DataItem, "product_id")); %>"></div>
</ItemTemplate>
</asp:DataList>
</div>
public partial class CommonCx_captcha_displaynews : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
DataList_News.DataSource = MySqlManager.ExecuteSelectCommand("select * from news;");
DataList_News.DataBind();
}
public bool DisplaySpace(System.String id)
{
return false;
}
}
的「>什麼是服務器標籤不正常形成 –
Benson
總之服務器標籤沒有正確形成 – Benson
對不起,提出奇怪的問題,但根據http://msdn.microsoft.com/en- us/library/2d76z3ck.aspx它說return system.string – Benson