tags:

views:

205

answers:

3

Hi all. I've programmed in both classic ASP and ASP.NET, and I see different tags inside of the markup for server side code.

I've recently come across a good blog on MSDN that goes over the difference between <%= and <%# (<%# is evaluated only at databind, and <%= is evaluated at render), but I also see <%$ and <%@.

I believe <%@ loads things like assemblies and perhaps <%$ loads things from config files? I'm not too sure.

I was just wondering if anyone could clarify all of this for me and possibly explain why it's important to create so many different tags that seemingly have a similar purpose?

Thanks!

EDIT Thanks everyone for your answers and clearing that up.

+2  A: 

You've covered 2 of them (<%# is evaluated only at databind, and <%= is evaluated at render), and the answer for "<%@" is that it's compiler directives (ie., stuff like what you'd put on a compiler's command line).

I don't know about "<%$".

Michael Burr
+2  A: 

They're sometimes referred to as bee stings.

http://stackoverflow.com/questions/115159/when-should-i-use-and-in-asp-net-controls

Spencer Ruport
+17  A: 
<%$ - is for accessing resource variables
<%@ - is for Page directives, Registering assemblies, importing namespaces, etc.
<%= - is short-hand for Response.Write
<%# - is used for data binding expressions.
Jose Basilio