本文整理汇总了C#中System.Web.UI.WebControls.LinqDataSourceSelectEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# LinqDataSourceSelectEventArgs类的具体用法?C# LinqDataSourceSelectEventArgs怎么用?C# LinqDataSourceSelectEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LinqDataSourceSelectEventArgs类属于System.Web.UI.WebControls命名空间,在下文中一共展示了LinqDataSourceSelectEventArgs类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LinqDataSource_Selecting
protected void LinqDataSource_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
ExampleDataContext exampleContext = new ExampleDataContext();
e.Result = from p in exampleContext.Products
where p.Category == "Beverages"
select new {
ID = p.ProductID,
Name = p.Name
};
}
示例2: Page_Load
public partial class Default3 : System.Web.UI.Page
{
string[] citiesArray =
{
"Atlanta",
"Charlotte",
"Denver",
"New York",
"San Francisco"
};
protected void Page_Load(object sender, EventArgs e)
{
}
protected void LinqDataSource_Selecting(object sender, LinqDataSourceSelectEventArgs e)
{
var cities = from city in citiesArray
where city.CompareTo("B") > 0
select city;
e.Result = cities;
// Or we could set e.Result = citiesArray to return all rows.
}
}