Search code examples
asp.netdata-bindingevalbind2-way-object-databinding

What is Two Way (2-way) data binding in ASP.NET?


What is 2-way data binding in ASP.NET. I heard Bind() is two way data binding approach.

How it is different from databinder.eval or Eval()?

What is the advantage of 2-way databind and in what kind of situation one should go for 2-way data binding and use Bind() instead of databinder.eval()?

Please, discuss in detail.


Solution

  • For read-only values such as Labels you can use the Eval() statement, and for read-write values such as TextBoxes (also known as "two-way databinding") you can use the Bind() statement