3

More detail to my question:

HTML and JavaScript are called "client-side code".

C# and VB in the code behind files are termed "server-side code".

So what is inline-asp, and 'runat=server' code blocks called?

<!-- This is called "client-side" -->
<p>Hello World</p>
<script>alert("Hello World");</script>

...

// This is called "server-side"
public void Page_Load(object sender, EventArgs e)
{
    Response.Write("Hello World");
}

...

<%-- What is this called ??? --%>
<asp:Label ID="MyLabel" runat="server" />
<% Response.Write("Hello World"); %>

The best term I can come up with is "Web Forms Code".

Doctor Jones
  • 21,196
  • 13
  • 77
  • 99
Timothy Khouri
  • 31,315
  • 21
  • 88
  • 128
  • All excellent answers, and some very good comments! I especially appreciate BobC for explaining why this is (sadly) important. – Timothy Khouri Nov 24 '08 at 16:02

5 Answers5

14

To be explicit, Microsoft calls them Embedded Code Blocks.

http://msdn.microsoft.com/en-us/library/ms178135.aspx

They are code blocks embeded into the page lifecycle by being called during the Render phase.

JoshBerke
  • 66,142
  • 25
  • 126
  • 164
9

The sections of an ASP page that start with <% and end with %> are code render blocks and <script> elements with runat=server are called code declaration blocks. The code inside them is server code.

The parts that begin with <%@ are directives. The code render blocks that begin with <%= is just short hand for a call to writer.Write() in the Page.Render() method.

Mark Cidade
  • 98,437
  • 31
  • 224
  • 236
2

In the ASP section of the MSDN site they are referred to as "script commands", "server side script commands" and "primary script commands".

Below I have included excerpts from the MSDN site and a reference link.

ASP uses the delimiters <% and %> to enclose script commands. Within the delimiters, you can include any command that is valid for the scripting language you are using.

Commands enclosed by delimiters are called primary script commands, which are processed using the primary scripting language. Any command that you use within script delimiters must be valid for the primary scripting language. By default, the primary scripting language is VBScript, but you can also set a different default language.

(http://msdn.microsoft.com/en-us/library/ms524741.aspx)

Doctor Jones
  • 21,196
  • 13
  • 77
  • 99
1

I call them "server tags" or "server-side tags".

No idea if this is correct or not.

Gabe Sumner
  • 4,978
  • 6
  • 33
  • 43
0

Code in the aspx file is called "the markup". That includes static html, as well. If you want to narrow it down to code within <% %> tags just say "code blocks".

The <% %> tags themselves and similar are called "Bee Stings". Note that this is just for the different types of <% %> tags, not the code blocks you create with them.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
  • 1
    Bee Stings. That's an interesting name. Do you know why this is called so? I might google it later, but it seems like an interesting addition to your post (if you know why). – Thomas Owens Nov 24 '08 at 15:19
  • surprisingly, google isn't much help- there's just too much noise and you can't filter effectively using 'ASP' or 'PHP', since they match any page with that in the url. The best I can come up actually points back to StackOverflow, and only mentions them in passing. – Joel Coehoorn Nov 24 '08 at 15:36
  • "Markup" refers to the HTML markup in the aspx/ascx file, not to code specifically. – technophile Nov 24 '08 at 15:38
  • Anyway: here's one place I found a "bee stings" reference: http://stackoverflow.com/questions/115159/when-should-i-use-and-in-aspnet-controls – Joel Coehoorn Nov 24 '08 at 15:54
  • 2
    Personally, my reasoning for the name is that seeing too many of these in the markup is almost as painful as being stung by a bee ;) – Joel Coehoorn Nov 24 '08 at 19:25