简单教程
提交运行
代码编辑器:
@{ var db = Database.Open("SmallBakery") ; var selectQueryString = "SELECT * FROM Product ORDER BY Id"; var data = db.Query(selectQueryString); var grid = new WebGrid(data); } <!DOCTYPE html> <meta charset="utf-8" /> <title>Displaying Data Using the WebGrid Helper</title> <h1>Small Bakery Products</h1> <div id="grid">@grid.GetHtml()
运行结果: