Items By Type: Tutorial

Working With Entity Framework Code First And JSON In ASP.NET Web Pages

Sunday, July 22, 2012 8:46 PM

Entity Framework ASP.NET Web Pages WebMatrix

If you want to build AJAX powered rich client interfaces with ASP.NET Web Pages, you will work with JSON - a lot. You might also be attracted to the Entity Framework for your data access technology. There are some special considerations to take account of when serialising Entity Framework objects to JSON for use in Web Pages applications. This article explores some of the issues you will encounter through the example of a simple To Do list manager.

Click to read more about Working With Entity Framework Code First And JSON In ASP.NET Web Pages ...

Viewed 90269 times

2 Comments for this item

Transferring Data Between ASP.NET Web Pages

Saturday, July 14, 2012 8:24 PM

ASP.NET Web Pages WebMatrix

There are a huge number of articles and blog posts on persisting data between user requests in ASP.NET. However, the ASP.NET Web Pages framework introduces a couple of additional mechanisms so this article explores those, as well as reviewing some of the standard approaches already available to Web Pages developers from other parts of the ASP.NET framework.

Click to read more about Transferring Data Between ASP.NET Web Pages ...

Viewed 134692 times

17 Comments for this item

Validation In Razor Web Pages 2

Thursday, June 14, 2012 12:47 PM

jQuery ASP.NET Web Pages WebMatrix Razor

The new release of ASP.NET Web Pages - version 2 - doesn't include many obvious changes, but the most significant one is an enhanced Validation system. A couple of new classes have been introduced, and Web Pages validation now works with the MVC Unobtrusive jQuery validation library. This article explores the new validation system and sees what it brings to the party.

Click to read more about Validation In Razor Web Pages 2 ...

Viewed 103880 times

19 Comments for this item

Using Knockout With Razor Web Pages In WebMatrix 2

Saturday, June 9, 2012 11:40 AM

jQuery ASP.NET Web Pages WebMatrix Razor

Knockout is an increasingly popular JavaScript UI library. Its popularity is likely to increase among ASP.NET developers soon as it comes as part of some of the new MVC 4 site templates. This article looks at what Knockout is, what problems it is intended it solve and how to use it in an ASP.NET Razor Web Pages site built in WebMatrix.

Click to read more about Using Knockout With Razor Web Pages In WebMatrix 2 ...

Viewed 22213 times

6 Comments for this item

Efficiently Displaying Hierarchical Data With The jQuery Accordion In Razor Web Pages

Sunday, June 3, 2012 10:30 AM

jQuery ASP.NET Web Pages WebMatrix Razor

A frequent requirement is to display data hierarchically, such as products by category. This article shows how to use LINQ to Objects and the jQuery Accordion to display the result of a database query in such a fashion within Razor Web Pages.

Click to read more about Efficiently Displaying Hierarchical Data With The jQuery Accordion In Razor Web Pages ...

Viewed 20597 times

6 Comments for this item

View Model Design And Use In Razor Views

Saturday, May 26, 2012 11:21 PM

ASP.NET MVC Razor

The recommended practice for transferring data to and from views in ASP.NET MVC is to use a View Model. But what is a View Model? How to you design one and how should they be used? This article attempts to provide answers to those questions.

Click to read more about View Model Design And Use In Razor Views ...

Viewed 66351 times

9 Comments for this item

More Flexible Routing For ASP.NET Web Pages

Wednesday, February 1, 2012 9:52 PM

ASP.NET Web Pages WebMatrix Razor

The built-in Web Pages routing system offers a fair degree of freedom in terms of how friendly URLs can be constructed and managed. However, the major limitation with the standard routing mechanism is that it relies on matching segments of the URL to files on disk. ASP.NET MVC and Web Forms enjoy a much more flexible routing system. This article looks at a Package that brings full ASP.NET routing control to Web Pages and examines how to use it.

Click to read more about More Flexible Routing For ASP.NET Web Pages ...

Viewed 29058 times

14 Comments for this item

Using The Themes Helper In Razor Web Pages

Monday, January 2, 2012 6:31 PM

ASP.NET Web Pages WebMatrix Razor

Web site skinning is a concept where by a web application user can personalise their experience, by choosing from a selection of prepared themes or skins. Each theme or skin might offer a different design, or content, or both. ASP.NET Web Forms has included a comprehensive Themes framework since version 2.0. WebMatrix developers can find Themes management functionality in the ASP.NET Web Helpers Library package available through the Package Manager. This article looks at how the Themes helper works.

Click to read more about Using The Themes Helper In Razor Web Pages ...

Viewed 30807 times

11 Comments for this item

Building A Razor Web Pages Site With Database First And Entity Framework

Friday, December 30, 2011 3:25 PM

Entity Framework ASP.NET Web Pages WebMatrix Razor

Since I published an item covering Code First development with Entity Framework and WebMatrix, I have had a few requests to provide a guide to working with the Entity Framework from a database first point of view. This post answers those requests and provides a step by step guide to getting up and running with a WebMatrix web site based on the Northwind sample database that comes with SQL Server CE 4.0.

Click to read more about Building A Razor Web Pages Site With Database First And Entity Framework ...

Viewed 37994 times

7 Comments for this item

HTML Helpers For Forms In Razor Web Pages

Sunday, December 25, 2011 11:27 AM

HTML ASP.NET Web Pages WebMatrix Razor

A nugget that has remained partially hidden from view within the Web Pages framework is the HtmlHelper class. Parts of this class peek out in the template sites provided in WebMatrix where validation is performed and related messages displayed, but a vast range of methods designed for rendering form inputs are often overlooked in tutorials, blog articles and books (mine included). This article provides an overview of Web Pages HTML Helpers, and digs into one or two in more detail.

Click to read more about HTML Helpers For Forms In Razor Web Pages ...

Viewed 127895 times

10 Comments for this item

Globalization And Localization With Razor Web Pages

Monday, October 10, 2011 9:35 PM

ASP.NET Web Pages WebMatrix Razor

Globalization is the process of preparing your site so that it is accessible to as wide an audience as possible. This is largely achieved by presenting content in the native language of the visitor. This article explores how you can approach this task within the ASP.NET Web Pages framework.

Click to read more about Globalization And Localization With Razor Web Pages ...

Viewed 79685 times

10 Comments for this item

Entity Framework Code First Development With WebMatrix

Monday, September 5, 2011 5:27 PM

Entity Framework ASP.NET Web Pages WebMatrix Razor

The existing data access story for WebMatrix is the Database Helper. Microsoft's recommended data access technology going forward is the Entity Framework (EF). This article explores how to use the Code First capability offered by EF within an ASP.NET Web Pages application.

Click to read more about Entity Framework Code First Development With WebMatrix ...

Viewed 33874 times

11 Comments for this item

The WebGrid - Efficient Paging And Sorting With SQL CE 4.0

Sunday, August 28, 2011 10:46 PM

ASP.NET Web Pages WebMatrix Razor WebGrid

A problem inherent in the existing version of the WebGrid is that it is not very efficient when it comes to paging data out of the box. If you have 10,000 rows of data, and you want to display 10 rows per page, all 10,000 rows are retrieved from the database for each page. The grid works out how to only show the current 10, and wastes the other 9,990 rows. That's a fair sized overhead on each page. Ideally, you should only retrieve the data you need for each page. This article examines how you can do that with the existing WebGrid and a SQL CE database, while still maintaining sorting capabilities.

Click to read more about The WebGrid - Efficient Paging And Sorting With SQL CE 4.0 ...

Viewed 16807 times

9 Comments for this item

jQuery Autocomplete with Razor Web Pages and a SQL CE Database

Tuesday, August 16, 2011 9:23 AM

jQuery ASP.NET Web Pages WebMatrix Razor

There are a number of autocomplete solutions for jQuery, including the widget that comes as part of the jQuery UI library. This article looks at incorporating the jQuery UI Autocomplete widget into a Razor-based ASP.NET Web Pages site.

Click to read more about jQuery Autocomplete with Razor Web Pages and a SQL CE Database ...

Viewed 28418 times

8 Comments for this item

WebMatrix and jQuery Forms Part 2 - Editing Data

Saturday, August 6, 2011 5:33 PM

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

This article continues on from one I wrote a while ago, showing how to use jQuery to create a data entry form in conjunction with the WebGrid. The original article prompted a number of requests to show how to extend the example to provide editing functions, and now I have found some time to answer those requests.

Click to read more about WebMatrix and jQuery Forms Part 2 - Editing Data ...

Viewed 20938 times

5 Comments for this item

Recent Comments

kawish 4/24/2015 7:04 AM
In response to Using The Themes Helper In Razor Web Pages
Nice:)...

Mahdi 4/23/2015 9:49 PM
In response to Adding a New Row In The Razor WebGrid
Thank u very very. its useful for me...

Jerrie Pelser 4/23/2015 4:24 PM
In response to Entity Framework 6 Recipe: Storing And Managing Time
Nice article Mike! I think there is an error in the House property getter of MovieFormModel. Your...

mike 4/22/2015 4:45 PM
In response to Parameter Queries in ASP.NET with MS Access
If the insert statement got failed how w can i get the error message of as string?...

frank 4/22/2015 9:44 AM
In response to Sessions in ASP.NET 5
Mike can you write up an article showcasing the difference / upgrade paths of ASP.net Web Pages and...

Scott 4/21/2015 11:39 PM
In response to ASP.NET MVC DropDownLists - Multiple Selection and Enum Support
Excellent! Just what I need for the current application I am working on. Even to the extent that I a...

Benjamin 4/21/2015 4:57 AM
In response to Creating a Connection String and Working with SQL Server LocalDB
Hi Mike, great article. I am learning a lot. As commented @Evita, the <Key> Data Annotation is I...

Wayne Hudson 4/20/2015 9:14 PM
In response to Inline Editing With The WebGrid
Thank you very much for your articles. They've helped me a lot. How would you handle inline such...

Dan 4/20/2015 5:01 PM
In response to Sessions in ASP.NET 5
Can I ask how these sort of options are affected by the IIS configuration options when hosted in be...

Shaheen 4/20/2015 3:36 PM
In response to Conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value
Perfect! Saved me from wasting hours....