asp.netsyntaxtags

ASP.NET "special" tags


What is the official name for the "special" ASP.NET tags like this:

<%# %>
<%= %>
<%@ %>
<%$ %>

I can't seem to figure out the conceptual or well known name for these, so I'm having trouble searching for more info. As a bonus, can anyone give me a quick rundown of all of the possible "special tags" and what each one of them does (or point me to a resource)?


Solution

  • The official name is "server-side scripting delimiters" or "ASP.NET inline expressions". Visual Studio 2008 syntax highlighting settings dialog calls these "HTML Server-Side Script". Microsoft people call them "code nuggets" in their blogs.

    There is also a Code Declaration Block, the final Embedded Code Block form.

    <script runat="server">
    bool IsTrue() {
      return false;
    }
    </script>
    

    This is used to include additional members (methods etc.) to the class generated from the ASP.NET markup. These have only ever been provided "primarily to preserve backward compatibility with older ASP technology" and are not recommended for use.