اگر بخواهید از الگوی MVP در برنامههای ASP.NET استفاده کنید بایستی بتوانید همه چیز را به CodeBehind انتقال دهید. این یعنی declarative و binding تقریباً تعطیل. یکی از امکانات مهمی که این وسط از دست میرود، امکان Paging بهینه کنترل GridView از طریق CodeBeind است. منظور از Paging بهینه فقط نمایش pager در قسمت پایین …
تصور کنید تعدادی کوئری SQL دارید که میخواهید Paging را با استفاده از NHibernate در آنها فعال کرده و بنا به دلایلی اجازه بازنویسی آنها با دیگر APIهای NHibernate نداشته و آنها را صرفاً باید از طریق ObjectDataSaource به کنترلهای ASP.NET بخورانید. سه راه برای انجام این کار وجود دارد. راه اول: استفاده از stored …
Named SQL query in NHibernate is an easy way to apply paging through native SQL. SetFirstResult and SetMaxResults helps a lot here. But the problem is when query is get a bit complicated or for some other reasons that I don’t know, paging does not works on pages after first page. In this case a …
ASP.NET GridView and other similar controls that support paging needs special methods that return only the requested slice of data and the count of total data. As I’m a lover of NHibernate/Castle ActiveRecord I have gathered paging techniques in NHibernate HQL, LINQ-to-NHibernate and Castle ActiveRecord: NHIbernate HQL: public IList GetData(int page, int pageSize, ref long …
بیشتر کارهای کنترلهای ASP.NET را هم میتوان به صورت Declartive و هم در Codebehind انجام داد. یکی از این کارها عملیات Paging در GridView است. متاسفانه یک محدودیت ظریف در حالت غیر Declarative وجود دارد که کار را برای کسانی که همه کارهای کنترلهایشان را در Codebehind انجام میدهند سخت کرده است. اگر GridView را …
Paging and sorting is a common need in ASP.NET applications. GridView itself have a default paging and sorting mechanism. Default paging has performance issues while manipulating large amounts of data. So people use a custom paging mechanism. This way they must note that only needed data must be extracted from database. For example when page …