0

As per the question. Can someone advise, what are the best practices for binding data to UI.

Lets assume, I am working with a ASP.NET Web Form application, and there is a gridview Many code examples I have seen have the gridview bound to a datasource on the Markup and this could lead to issues when db is amended. On the other hand, if it was done code behind, then it would not be so problematic. But is there a trade off in terms of performance when making your datasource code behind? instead of binding it on the markup? I have seen a similar question as well Best practices for DataBinding in asp.net for maintainability. But that was in 2009, and alot of ideas, design and development patterns have changed and evolved since then.

Community
  • 1
  • 1
chigz
  • 7
  • 4
  • I personally believe data binding from the code behind gives you more control over binding from the markup. – Sam Sep 23 '14 at 01:15

1 Answers1

0

My .NET webform experience is quite old, but if my memory serves well, data Data binding from code-behind is far more handy. It is more logical as well, as pure markup should mean structure. Naturally, when you use a framework, you can use templates in it, but the structure of the web form should not deal with data binding. This is my opinion only.

Lajos Arpad
  • 53,986
  • 28
  • 88
  • 159