Reputation: 259
where we use <%@ %>
<%= %>
<%# %>
etc.
what else asp tags can be added in asp.net web pages?
Upvotes: 9
Views: 4344
Reputation: 499382
<%%>
is short hand for:
<script runat="server">
</script>
Anyting inside the <%
and %>
is server side code.
The other variants are also shortcuts:
<%@%>
is a page directrive<%=%>
is short for Response.Write
<%:%>
is short for Response.Write
, adding html encoding (introduced with .NET 4.0)<%#%>
is a binding expressionThis page is a good reference to all these.
Upvotes: 15
Reputation: 176956
<%@ %> - page directives, Register control
<%= %> - for the server code
<%# %> - for the eval kind of function its also for the server code
Upvotes: 0