2013-08-21 38 views
0

我一直在使用它們很多,但我不確定你稱它們爲什麼。你在ASP.NET中稱什麼「<%= %>」和「<%# %>」?

此外,有什麼定義的地方他們的工作是什麼/如何?我很難搜索,因爲我不知道他們叫什麼。

+3

[嵌入式代碼塊(http://msdn.microsoft.com/en-us/library/ms178135(V = VS.100)的.aspx) –

+1

[Inline expressions](http://support.microsoft.com/kb/976112) –

回答

1

嵌入式代碼塊。

種類有這些:

<%= %> is the equivalent of `Response.Write()` 
<% %> runs server-side code, like an if-else block 
<%: %> is for HTML-encoding the data 
<%# %> is for data-binding expressions 
<%@ %> is for directives, usually page directives in ASP.NET 
相關問題