What is the difference in:
Text='<%# Eval("LocationType")%> vs Text='<%#Bind("LocationType") %>'>
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The Bind keyword works like Eval to display data and can retrieve the value you’ve entered when updating or inserting a record.
In addition, Bind is very useful in TemplateFields used in the GridView and DetailsView. Bind stores the value of the bound control property into a collection of values that the FormView control automatically retrieves and uses to compose the parameter list of the insert or edit command. The argument passed to Bind must match the name of a field in the data container.
For example, the textbox in the code snippet provides the value for the notes field.
‘ />
The .NET Framwork 2.0 introduces Eval(). Eval() is a shortcut for Container.DataItem().
Since Eval() uses Reflection, it causes overhead. From a optimization standpoint, it is better to use Container.DataItem().