While editing an aspx file I found both these opening tags used for seemingly the same thing. Is there a difference and if yes, what is it?
The difference is that the # symbol specifies a data binding directive, that is resolved at data binding time (for example, when you call Page.DataBind ) and the = sign specifies an evaluation expression just evaluates and prints to the HTML output when that line is processed.
Edit: Just adding that only inside <%# %> you have acces to databinding functions like Eval.
<%=
is a equivalent to <% Repsonse.Write()
You can write any content out here: for example
<%=myProperty + " additional Text" %>
<%#
is a binding expression. You can retrieve any public value in the current context (for example in GridViews). But you cannot mix content here.
Take a look at MSDN for more information.
<%= is shorthand for Response.Write().
<%# indicates that you're working with the data container in a data bound control.