I tried to find what the difference is between these two with Google, but I could not find an exact definition, and I could not exactly search for symbols either.
Right now I know that you can put a piece of code between <%# %> and you have to call Page.DataBind() method to apply it, I think this is how <%# %> works. But what does <%= %> mean? When should I use it?
The Basic differences are:
The
<%= %>expressions are evaluated at render time.The
<%# %>expressions are evaluated atDataBind()time and are not evaluated at all ifDataBind()is not called.<%# %>expressions can be used as properties in server-side controls.<%= %>expressions cannot and are used to reference properties or fields.For example:
You can have a more detailed explanation on msdn here: What’s the difference between <%= %> and <%# %>
Hope this helps.