Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asp.net server-side code block explanations

I've seen many different types of server side code blocks in aspx but never a simple key for what each means. I know some of these but it's really hard to search for symbols in a search engine! Can you help me out?

<% %> 
<%-- --%> 
<%@ %>
<%= %>
<%: %>
<%$ %>
<%# %>
like image 256
Michael Avatar asked Jun 15 '11 22:06

Michael


1 Answers

  • <% %> - Server side code
  • <%-- --%> - Server Side Comment
  • <%@ %> - Page Directive
  • <%= %> - Display value
  • <%: %> - HTML Encode
  • <%$ %> - Datasource Expression
  • <%# %> - Binding Expression

You can find a bit more information about some of them at "ASP.NET Page Syntax".

like image 141
mdm Avatar answered Nov 05 '22 03:11

mdm