Newbie - the difference between <%: %> and <%= %>

Z

Zalek Bloom

Is there any difference between <%: %> and <%= %> ?

I noticed in a code I copied there was: <%: ViewData["Test1Message"]
%>

I changed it to <%= ViewData["Test1Message"] %> and got the same
results.

So <%: and <%= can be used to display a data?

Thanks,

Zalek
 
J

Jeff Johnson

Is there any difference between <%: %> and <%= %> ?

<%: %> ??? Really? I've never seen this, but I'm no Web guru either. I've
definitely seen <%# %>, which I associate with data binding, but never the
version with the colon.

I asked my co-worker if there was any difference between <%# %> and <%= %>
and he said

"The pound-sign denotes late-bound evaluation, while the absence of it
denotes early-bound evaluation. But, most of the time, they achieve
identical effects."

Then I asked if he'd ever seen <%: %>

"Not that I can recall."

And Pete's right: you've got a much better chance of getting answers to
these kinds of questions in an ASP.NET-specific group. And nowadays that
pretty much means you have to find a Web forum.
 

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

Top