<% versus <%#

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?
 
S

Scott M.

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

-Scott
 
D

Derek Fountain

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...
 
H

Hillbilly

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top