1

Possible Duplicates:
When should I use # and = in ASP.NET controls?
What is the difference between <% %> and <%=%>?

I have seen samples with "<%#", "<%=" and "<%". First of all, is there a name for these things? Second, where can I find a reference that tells what the different versions do? I have tried searching, but can't find anything.

Community
  • 1
  • 1
dna86
  • 407
  • 2
  • 7
  • 18

4 Answers4

1

Check out the differences at (there are some you missed and I'm not going to re-key all the information when it's already referenced elsewhere):

Inline ASP.NET Tags...Sorting Them All Out

Justin Niessner
  • 242,243
  • 40
  • 408
  • 536
0

They're commonly referred to as "bee stings".

What is the difference between <% %> and <%=%>?

Community
  • 1
  • 1
Spencer Ruport
  • 34,865
  • 12
  • 85
  • 147
0

The difference between <% %> and <%= %> is discussed here. In essence the <%= %> variant is used used to output the result of an expression, while the version without the = is just used to execute some code.

The <%# %> version is used for data binding, and its use is discussed on this Microsoft support page.

The official name for this syntax is Server-Side Scripting Delimiters. Much more info can be found in the answers to question 649428.

Community
  • 1
  • 1
Richard Fawcett
  • 2,799
  • 1
  • 29
  • 36
0

Here is a handy little article that I found:

http://naspinski.net/post/inline-aspnet-tags-sorting-them-all-out-(3c25242c-3c253d2c-3c252c-3c252c-etc).aspx

Justin Rassier
  • 898
  • 12
  • 26