Bài đăng

HTML-CSS Canh thẻ div nằm giữa màn hình

Hình ảnh
<style>  #content { position: absolute; top: 50%; left: 50%; height: 150px; margin-top: -75px;/* height/2 */ width: 220px; margin-left: -110px; /* width/2 */ background: red; } </style> <div id="content"> </div> Kết quả: Còn nếu bạn không biết trước chiều rộng và chiều cao thì thế nào? Khi ấy chúng ta sẽ kết hợp javascript để lấy ra chiều rộng, chiều cao của thẻ có thuộc tính id là content, rồi write ra css.  Sưu tầm

Retrieve paged lists from DAL theo codeutil.wordpress.com

Objective: Create an easy way to retrieve paged lists from the data access layer when using Entity Framework. Steps: Create an interface that defines a paged list:  IPagedList<T> . Create a class  PagedList<T>  that implements IPagedList<T>. Create a  Linq extension method  that can be applied to an Entity Framework query and returns a paged list. Optional:  If you are using the  repository pattern  you can use IPagedList<T> to return paged lists. Code  :) 1. Define an interface for the paged list. 1 2 3 4 5 6 7 8 9 10 11 12 13 using System.Collections.Generic;   namespace Demo.Paging {      public interface IPagedList<T>      {          int PageSize { get ; }          int TotalNumberOfItems { get ; }          IList<T> CurrentPage { get ; }          int CurrentPageNumber { get ; }          int TotalNumberOfPages { get ; }             } } 2. Implement the class for t