本文整理汇总了C#中System.Web.UI.WebControls.ObjectDataSource.StartRowIndexParameterName属性的典型用法代码示例。如果您正苦于以下问题:C# ObjectDataSource.StartRowIndexParameterName属性的具体用法?C# ObjectDataSource.StartRowIndexParameterName怎么用?C# ObjectDataSource.StartRowIndexParameterName使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类System.Web.UI.WebControls.ObjectDataSource
的用法示例。
在下文中一共展示了ObjectDataSource.StartRowIndexParameterName属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: rowsToDisplay_SelectedIndexChanged
protected void rowsToDisplay_SelectedIndexChanged(object sender, EventArgs e)
{
GridView1.PageSize = int.Parse(rowsToDisplay.SelectedValue);
}
开发者ID:.NET开发者,项目名称:System.Web.UI.WebControls,代码行数:4,代码来源:ObjectDataSource.StartRowIndexParameterName
示例2: GetSubsetOfEmployees
public class CustomerLogic
{
public List<Customer> GetSubsetOfEmployees(int startRows, int maxRows)
{
NorthwindDataContext ndc = new NorthwindDataContext();
var customerQuery =
from c in ndc.Customers
select c;
return customerQuery.Skip(startRows).Take(maxRows).ToList<Customer>();
}
public int GetEmployeeCount()
{
object cachedCount = HttpRuntime.Cache["TotalEmployeeCount"];
if (cachedCount != null)
{
return int.Parse(cachedCount.ToString());
}
else
{
NorthwindDataContext ndc = new NorthwindDataContext();
var totalNumberQuery =
from c in ndc.Customers
select c;
int employeeCount = totalNumberQuery.Count();
HttpRuntime.Cache.Add("TotalEmployeeCount", employeeCount, null, DateTime.Now.AddMinutes(5), Cache.NoSlidingExpiration, CacheItemPriority.Normal, null);
return employeeCount;
}
}
}
开发者ID:.NET开发者,项目名称:System.Web.UI.WebControls,代码行数:33,代码来源:ObjectDataSource.StartRowIndexParameterName