<% versus <%#

  • Thread starter Thread starter Derek Fountain
  • Start date Start date
D

Derek Fountain

Just working through some beginners tutorials over at asp.net, I came
across the use of the <%# construct to embed code snippets. Eg:

<asp:HyperLink ID="HyperLink2" runat="server"
NavigateUrl='<%# Eval("Url") %>'>
<%# Eval("Title") %>
</asp:HyperLink>

All the documentation I can find says code is embedded with <% %> tags.
I can't find any mention of the the additional # symbol anywhere. Yet if
I remove it, the examples stop working.

Can someone point me at the thing I'm supposed to read that makes sense
of this?
 
<% %> are the delimeters that indicate server side code. The # symbol is
used to represent a databind or eval operation.

-Scott
 
Scott said:
<% %> are the delimeters that indicate server side code. The # symbol is
used to represent a databind or eval operation.

-Scott

Do you have a link to something I can read on this? It's all very new
to me, and I didn't even know such special symbols existed...
 
ASP.NET 2.0 Expression Builders is what you want to research as there are
other types of expressions you will want to know about
 
Back
Top