Hi Guest

MobileUser

1 HomePage 1 Jobs 1 WalkIn 1Articles  

Cat Exam

 :) Latest Topic
AJAX
VB.NET
SQL Query
UDDI
CLASS
JavaScript Questions
SharePoint Interview
SilverLight
WCF
general knowledge
 ASP.NET
 :) Hot Jobs
 
 :) Latest Articles


  

 


Difference in between Bind and Eval function in dotnet?
Question Posted on 11 Dec 2023

Home >> DotNet >> ASP.NET >> Difference in between Bind and Eval function in dotnet?




Difference in between Bind and Eval function in dotnet?
Below are the difference in between Bind and Eval function in asp.net:-
0
0

NumberBase of differenceBind FunctionEval Function
1BindingWell when we say about the Bind function , it used for two-way binding (Write and Read). For example when you want to update any database field, here you will be using TextBox and thus by using bind function.Well when we say about the Eval function, it used to define one-way binding(Read only). For example when we say control like GridView or the FormView. We use this to display read only data by using a label control. We will use this function.
2USed For Well when we say about the Bind function it can be used to bind data to control inside a DataBound control and also it can update the values back to database.Well when we say about the Eval function, it can be used to bind data to control inside a DataBound control, but it cannot update the values back to the database.
3MethodWell when we say about the Bind function,it is a new ASP.NET 2.0 databinding keyword. It is not a method of any specific class.Well when we say about the Eval function, it is protected method define on the template control class, from which the Page class is derived.
4ControlsWell when we say about the Bind function, it applies to control like the GridView, FormsView and Detailsview.Well when we say about the Eval function, it applies to control like the GridView, DataList, Repeater, ListView, FormsView and DetailsView.
5Control ID It does not need the ID of a particular control. For example :- <table> <tr> <td><%#Eval("productname")%> </td> </tr> </table>It always needs the ID of a particular control. For Example:- <table> <tr> <td><%#Bind("productname")%> </td> </tr> </table> is WRONG. We have to take some UI control like Label and specify the Binding in the Text property. e.g., <ItemTemplate> <asp:Label ID="lblDOB" runat="server" Text='<%# Bind("DOB") %>'></asp:Label> </ItemTemplate>


 
 Input Your Comments Or suggestions(If Any)
 Name
 Email(optional)
 Comments


Other Important Questions
Use of Calendar control in dotnet with code
How to improve Front End UI performance of dotnet web application?
File upload in dotnet
reverse a string
function of garbage collector






 
Top Searches:asp net questions vb net questions sql query uddl questions class javascript Questions sharepoint interview questions and concept silverlight questions and concept wcf questions beans general knowledge ajax questions
PHP | Biztalk | Testing | SAP | HR |