when to use #
used inside <% %>
?
<%# Eval()%>
what is the use of #
in this ?
what are the other options available like this?
when to use #
used inside <% %>
?
<%# Eval()%>
what is the use of #
in this ?
what are the other options available like this?
<%#%>
is known as the binding expression. The data-binding expressions can be used in attributes of server tags to assign calculated values to properties. Also they can be used like a separate tag.
You may check MSDN for details
<%# ... %>
The data-binding expression creates binding between a server control property and a data source when the control’s DataBind method of this server control is called on the page.
The following example shows how to use the data-binding expression to bind the string from a function to the Text property of a label:
<%@ Page Language="VB" %>
<script runat="server">
Protected Function SayHello() As String
Return "Hello World"
End Function
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs)
lblHello.DataBind()
End Sub
</script>
<html>
<body>
<form id="form1" runat="server">
<asp:Label ID="lblHello" runat="server" Text="<%# SayHello%>"></asp:Label>
</form>
</body>
</html>
what are the other options available like this?
From the same MSDN site. You may find the option like:-