3

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.

Leniel Maccaferri
  • 100,159
  • 46
  • 371
  • 480
Thomas
  • 33,544
  • 126
  • 357
  • 626

1 Answers1

4

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

liron
  • 375
  • 2
  • 12
  • we can also bind TextBoxes with DataBinder.Eval(). so why Bind() is required. what is the advantage of Bind(). plzz explain. thanks – Thomas Apr 06 '11 at 08:04
  • 2
    you can bind textbox with eval but for read only, if you want that the update/insert will work you will use bind. – liron Apr 06 '11 at 08:13