views:

279

answers:

4

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 <%#

+3  A: 

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

They're also called bee-stings:
http://stackoverflow.com/questions/517721/in-asp-net-what-is-the-difference-between-and

Joel Coehoorn
+1  A: 

<%# .. %>

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

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"

Zhaph - Ben Duguid