What is the Difference between Eval() and Bind Methods




       Eval()        Bind()  
1
Eval() Supports  one way Binding only.
Bind() Supports Two Way Binding.
2
Only Read data from Columns
Bind() we can Read & Write data From Column.
3
Eval() Control like the GridView or the FormView display Read only data using a label control
Bind () proper type of datasource, it will pull the altered values out of the GridView or other control 
4
Eval() Use without id control.
Ex:
<table><tr><td>
<%#Eval("username")%>
</td></tr></table>
        
Bind() Use Any Like any  Controls.
Ex:
<ItemTemplate>
                        <asp:Label ID="lblUsername" runat="server" Text='<%# Bind("username") %>'></asp:Label>
</ItemTemplate>








0 comments:

Post a Comment