Search code examples
asp.netdeclarative-programming

ASP.NET is based on declarative programming?


Recently I have noticed about a subtle restriction in GridView's paging mechanism. Efficient paging, loading just requested page of data, is only possible with using DataSource controls like ObjectDataSource that means declarative data binding and is impossible when not using a data source and just from codebehind (MSDN describes it here).

Does this means ASP.NET is based on declarative programming not code behind? And it's better to do declarative programming by default?


Solution

  • Out of the box WebForms tries to steer you down the declarative path. You can get around that and actually write code, but WebForms makes it extremely difficult.

    If you really want to have control then you should look into the ASP.NET MVC Framework.