Meaning of <%#

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

I can't seem to find any mention of what <%# means in any
of my ASP.NET text books. Searching msdn and Goggle for
<%# also results in nothing. Can anyone offer a URL that
has some definition?

Thanks,
Frank
 
I finally found some info on <%# when searching for Data
Binding Expression Syntax. It would be nice if MS would
add <%# to the help index in VS.NET like they did with <%
=.
 
Frank said:
I can't seem to find any mention of what <%# means in any
of my ASP.NET text books. Searching msdn and Goggle for
<%# also results in nothing. Can anyone offer a URL that
has some definition?

Frank,
Data binding individual control properties in Web Forms pages is not
implemented by directly tying the property to a source of data. Instead,
data binding is implemented by using a special expression format. The
data-binding expression is delimited with the characters <%# and %>.

For more information, please see:
http://msdn.microsoft.com/library/en-us/vbcon/html/vbcondata-bindingexpressions.a
 
<%# ... %> isn't just used in DataBinding expressions it is used in any kind
of binding say you wanted to bind a boolean return from a method you can do
that too. You can use it on anything that is marked as Bindable(true). I
tried this out once to find the difference between <%= and <%#. = is for
string returns and # is for binding to controls.

That is what I came up with.
 
Back
Top