<%% >
This statement accepts executable code, but does not return anything to the webpage.
It depends. In fact, that's not quite what you put in.
This is the inherited markup for Classic ASP. It simply performs some imperative instruction, not necessarily writing in HTML.
Now, I can perfectly write in HTML using the following form:
<% Response.Write("Estou escrevendo no HTML!"); %>
<% #% >
This statement also accepts executable code, but it is apparently limited to an expression and does not execute non-return methods. It also does not return anything to the webpage.
That's not quite it. This statement is for you to do bindings ( binding ) within another ASP.NET tag. For example:
<asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="Image2" runat="server" ImageUrl='<%# Eval("Coluna") %>' Width="70" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
In this case, <%# Eval("Coluna") %>
mocks data to <asp:Image>
.
<%:% >
This statement is identical to the above statement, but has its value returned to the webpage.
Actually <%: %>
is equivalent to <%= %>
, with the additional character encoding suitable for HTML .
There are other notations not mentioned in the question that can be found here .