3

In a .Net web form...

What are these special tags called?

I know of 2: <%-- comment --%> for comments

and <%# used with Eval and Bind #>

So what does the # signify? Are there more?

I know you can put some basic logic and function calls in there but I've never found anything that really describes how that can be used and should be used.

I hope this isn't a duplicate but it's really hard to search for <%#

easwee
  • 15,757
  • 24
  • 60
  • 83
rvarcher
  • 1,566
  • 1
  • 12
  • 14
  • Duplicate/Similar: http://stackoverflow.com/questions/517721/in-asp-net-what-is-the-difference-between-and-closed http://stackoverflow.com/questions/115159/when-should-i-use-and-in-asp-net-controls – Gavin Miller May 12 '09 at 19:55

4 Answers4

4

They're also called bee-stings:
In ASP.Net, what is the difference between <%= and <%#

Community
  • 1
  • 1
Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794
3

Server tags. They are called server tags.

Of course there are more.

<%= "string constant" %> - it will output a given string to the HTML output

<%= BO.Customer.GetName () %> - will do the same with the function that returns a string result

<% RenderMyCoolControl %> - without the "=" character, it is supposed that your function will render something to the HTML output using Response.Write

Or you can use that directly: <% Response.Write ("string constant") %>

Hope that helps.

User
  • 30,403
  • 22
  • 79
  • 107
1

Used for Binding Expressions; such as Eval and Bind, most often found in data controls like GridView, Repeater, etc

Are there more?

Take a look here:

Inline tags

TStamper
  • 30,098
  • 10
  • 66
  • 73
1

There's a fairly complete list here:

ASP.NET "special" tags

And as the accepted answer on there states, they are "Server Side Scripting Tags"

Community
  • 1
  • 1
Zhaph - Ben Duguid
  • 26,785
  • 5
  • 80
  • 117