What is the difference between having
<%# Eval("State") %>
in your aspx
page, versus having
<%# DataBinder.Eval(Container.DataItem, "State") %>
in your aspx
page?
<% ... %> is used to embed some java code within the main service() method of the JSP. It is executed during the rendering of the page. <%! ...
<%@ is the directive attribute. You may include a page or may declare a tag-library using <%@
Summary. The new <%: %> syntax provides a concise way to automatically HTML encode content and then render it as output. It allows you to make your code a little less verbose, and to easily check/verify that you are always HTML encoding content throughout your site.
In this JSP tags are used to insert JAVA code into HTML pages. It is an advanced version of Servlet Technology. It is a Web based technology helps us to create dynamic and platform independent web pages. In this, Java code can be inserted in HTML/ XML pages or both.
Eval("State")
is a simplified form of the DataBinder.Eval(Container.DataItem, "State")
syntax. It only works inside of data-bound template controls.
For more info, see the MSDN documentation.
There is no difference. The "Eval" method is just a shortcut for the DataBinder.Eval(Container.DataItem, "blah") method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With