views:

354

answers:

6

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".

+1  A: 

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

No idea if this is correct or not.

Gabe
+1  A: 

It certainly is a kind of server-side code. In classic ASP, it's called such, and I think we should still call it like that. But if you want to really discriminate between it and codebehind source (I really don't see a fundamental difference between them), you can call it inline-code or something like that. Server tag is a good name in classic ASP, but in ASP.NET, it'll probably be confused with server-side tags (WebControls).

After all, does it really matter!?

Mehrdad Afshari
Of course it matters:"Hey Jimmy, check out the inline, errr, scripting, ahhh web form code for that bug we talked about".
jfar
I agree. Jargon, loathsome though it may be, is a necessary shorthand when discussing complex topics. Unless you're precise in you language, misunderstandings are pretty much guaranteed. At best that's inconvenient. At worst, it can be catastrophic.
BobC
I agree on your point. But using terms that are not generally known, it might even make more confusion.Anyway, it doesn't hurt so you guys are right!
Mehrdad Afshari
A: 

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
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
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
"Markup" refers to the HTML markup in the aspx/ascx file, not to code specifically.
technophile
And that markup include <asp: > tags and code blocks.
Joel Coehoorn
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
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
+7  A: 

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
+11  A: 

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
+1  A: 

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.

Regards,

Docta

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)

DoctaJonez