introduction towebmatrix
DESCRIPTION
Presented at MUGH TechMeet , Hyderabad in October 2011TRANSCRIPT
- 1. Welcome toMUGH TechMeet October 2011
- 2. Introduction to WebMatrix Pranav Ainavolu Thomson Reuters Twitter: @a_pranav | Blog: http://pranavon.net
- 3. Agenda What is WebMatrix? Razor Syntax Database Access WebGrid
- 4. Introducing WebMatrix Create Customize Publish
- 5. Introducing WebMatrix Web Server Database Development Tool
- 6. Who is WebMatrix for? I
- Razor @for (int i = 0; i < 10; i++) {
- @i (2 markup transitions): }
HTML Block Your name: @name
} @{ var name = John Doe; Option 2: Text Block Your name: @name }
Option 3: @{ var name = John Doe; Single line of output @: Your
name: @name in markup } 11. Commenting in Razor @*
Option 1: Hello World Markup
*@ @{ Option 2: //var name = "John Doe; //@name Code } @* Option 3:
@{ var name = "John Doe"; Both @name } *@ 12. Razor syntaxDemo 13.
Database SQL Compact Edition File-based, so its portable. Runs
without a server. Easy to design, easy to code againstDesigning
Coding @{ var db = Database.Open("ArtGallery"); var product =
db.Query("SELECT * FROM PRODUCTS); } 14. Database AccessDemo 15.
Display your data easily with WebGrid Displays your data quickly
and easily Lots of options to customize layout, appearance, paging
etc.@{ var db = Database.Open("ArtGallery"); var data =
db.Query("SELECT * FROM PRODUCTS);
[email protected]( grid @{ new WebGrid(data); =} columns:
grid.Columns( var db = Database.Open("ArtGallery");
grid.Column("Name", "Product", style: "product"), var data =
db.Query("SELECT * FROM PRODUCTS);
} 16. WebGridDemo 17. Summary What is WebMatrix? Razor Syntax
Database Access WebGrid 18. Q&AThank You!grid = new WebGrid( format:@@item.Description),
grid.Column("Description", var @grid.GetHtml();
grid.Column("Price", format:@[email protected]) source: data,
) defaultSort: "Name", ) rowsPerPage: 3);