asp.net web网页问题

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NavigationControl.ascx.cs" Inherits="AspTest.Web.NavigationControl" %>
<%@ OutputCache Duration="100000" VaryByParam="*" %>

<asp:Repeater ID="repCategories" runat="server">
<HeaderTemplate>
<table cellspacing="0" border="0" style="border-collapse: collapse;">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td class="<%= ControlStyle %>"><asp:HyperLink runat="server" ID="lnkCategory" NavigateUrl='<%# string.Format("~/Products.aspx?page=0&categoryId={0}", Eval("Id")) %>' Text='<%# Eval("Name") %>' /><asp:HiddenField runat="server" ID="hidCategoryId" Value='<%# Eval("Id") %>' /></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>

请教各位大虾:
上面的代码中,<%= ControlStyle %> 及 <%# string.Format("~/Products.aspx?page=0&categoryId={0}", Eval("Id")) %>' Text='<%# Eval("Name") %> 
<%= %> <%# %>各代表什么意思呀?
能否提供一些关于这方面的资料,
谢谢了~~~~

30秒到达战场
浏览 363回答 2
2回答

隔江千里

<%= %>是内联表达式,用作调用Write方法的快捷方式.所以:"<%= ControlStyle %>"就表示,是Response.Write(ControlStyle)的快捷方式.<%# %>表示数据绑定.所以:<asp:HiddenField runat="server" ID="hidCategoryId" Value='<%# Eval("Id") %>' />就表示,HiddenField的值绑定到查询出的数据表列名为"ID"的数据列上.就你这个实例来看.这个数据表应该是对应到实例中"repCategories"这个Reaper的DataSource的DataTable或者DataSet.
打开App,查看更多内容
随时随地看视频慕课网APP