Items By Type: Tutorial

Enhancing The WebGrid With Sort Arrows

Friday, December 14, 2012 7:24 PM

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

The Web Pages WebGrid offers sorting capability out of the box. However, it's not always obvious to the user on which column the grid data is being sorted at any one time, nor the direction in which it is being sorted. The convention is to provide arrows in the column header to act as a clear visual cue. This article looks at a three ways in which you can enhance your grids with sorting arrows.

Click to read more about Enhancing The WebGrid With Sort Arrows ...

Viewed 27604 times

3 Comments for this item

Inline Editing With The WebGrid

Tuesday, November 13, 2012 10:37 AM

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

Unlike the Web Forms GridView control, the Web Pages WebGrid doesn't offer anything by way of inline editing capability. This article looks at one approach to solving that requirement through the addition of a sprinkling of jQuery.

Click to read more about Inline Editing With The WebGrid ...

Viewed 47202 times

31 Comments for this item

Cleaner Conditional HTML Attributes In Razor Web Pages

Tuesday, October 23, 2012 9:27 PM

ASP.NET Web Pages WebMatrix Razor

Every so often, you will want to conditionally render HTML attributes or their values within your Razor Web Pages based on the outcome of some runtime logic. Often, the logic required to manage this can become messy and lead to unnecessary spaghetti code. This article explores a few common scenarios and provides some solutions, as well as introducing a nice new feature that was released as part of Razor v 2.0.

Click to read more about Cleaner Conditional HTML Attributes In Razor Web Pages ...

Viewed 57929 times

7 Comments for this item

The SimpleMembershipProvider, Secure Passwords And The Crypto Helper

Thursday, September 27, 2012 1:39 PM

ASP.NET MVC ASP.NET Web Pages WebMatrix

Some people have questioned the security of the ASP.NET SimpleMembershipProvider's storage of passwords. The cause for concern seems to stem from the fact that the PasswordSalt field in the standard membership table is unused by the SimpleMembershipProvider, whereas it is used by, for example, SqlMembershipProvider. So what is the PasswordSalt field, and why should the fact that it isn't used raise an eyebrow?

Click to read more about The SimpleMembershipProvider, Secure Passwords And The Crypto Helper ...

Viewed 29073 times

6 Comments for this item

HTML5 Form Helpers For WebMatrix

Thursday, September 20, 2012 2:56 PM

Extension Method ASP.NET Web Pages WebMatrix HTML5

It's an odd thing: WebMatrix 2 is lauded for its support of HTML5, but the Web Pages framework doesn't include any helpers for the new HTML5 form input types such as email or color. It's fair to say that support among browsers for the new inputs is patchy at the moment, but with barely a week flying past without a new version of one or other browser being released, it won't take long for that to change. So in the meantime, if you prefer to use helpers, you have to write your own for rendering HTML5 forms.

Click to read more about HTML5 Form Helpers For WebMatrix ...

Viewed 32207 times

5 Comments for this item

Cannot use a lambda expression as an argument to a dynamically dispatched operation

Tuesday, September 18, 2012 8:08 AM

LINQ ASP.NET MVC ASP.NET Web Pages WebMatrix

Since the introduction of the Web Pages framework, ASP.NET has been making use of the dynamic type introduced in C# 4.0. Along with that comes some new error messages which at first glance don't make a lot of sense - mainly because they are unexpected. I have already looked at how dynamics do not support extension methods, and a recent question in the ASP.NET forums illustrated another way in which the dynamic type can catch you out.

Click to read more about Cannot use a lambda expression as an argument to a dynamically dispatched operation ...

Viewed 30943 times

1 Comment for this item

Optimising ASP.NET Web Pages Sites - Bundling And Minification

Saturday, September 15, 2012 5:05 PM

ASP.NET Web Pages WebMatrix

ASP.NET 4.5 saw the introduction of new features for improving the performance of web sites. Delivered within a new library called System.Web.Optimization, bundling and minification enables you to combine multiple JavaScript or CSS files into one bundle, and to minify them thereby reducing the number of HTTP requests that browsers have to make, reducing the size of the files, and improving performance of the site overall, especially over slower (read 3G) networks.

Click to read more about Optimising ASP.NET Web Pages Sites - Bundling And Minification ...

Viewed 51967 times

9 Comments for this item

WebMatrix - jQuery Cascading Dropdown Lists

Saturday, September 8, 2012 9:56 AM

jQuery ASP.NET Web Pages WebMatrix

I have looked at cascading dropdown lists with WebMatrix previously, but the approach I featured demonstrated the use of jQuery Templates. At the time, the jQuery Templates project looked promising, but since then, the jQuery team have decided not to take them beyond beta stage. So the reason for this article is to illustrate a more "traditional" jQuery approach to managing cascading dropdown lists when developing ASP.NET Web Pages using WebMatrix.

Click to read more about WebMatrix - jQuery Cascading Dropdown Lists ...

Viewed 21933 times

9 Comments for this item

ASP.NET Web Pages - Creating Custom Validators

Friday, August 31, 2012 2:33 PM

ASP.NET Web Pages WebMatrix

Version 2 of the Web Pages framework includes a new validation framework. Included are a number of specific validators that cover common scenarios such as validating for presence, data type or range. It may be however, that you want to create your own custom validator to test for something that isn't covered by the existing validators, or to combine multiple tests in one composite validator. Fortunately, the Web Pages team have made the validation system extensible so that you can create your own validators.

Click to read more about ASP.NET Web Pages - Creating Custom Validators ...

Viewed 20735 times

11 Comments for this item

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 94156 times

4 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 143936 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 107477 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 22818 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 21561 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 70906 times

9 Comments for this item

Recent Comments

Justin Kusuma 7/24/2015 3:38 AM
In response to Posting Data With jQuery AJAX In ASP.NET Razor Web Pages
Hi Mike, thanks much for sharing such an article :) Really help me a lot... further, I'd like to...

Michael Easterbrook 7/22/2015 5:35 PM
In response to Inline Razor Syntax Overview
I removed the @ symbols and I am still getting the same error. It only occurs when I have an "if" a...

Sujay 7/22/2015 1:36 PM
In response to ASP.NET MVC, Entity Framework, One-to-Many and Many-to-Many INSERTS
can you explain how to link two tables so that it forms many to many relationship?(Article and...

Max G 7/21/2015 9:29 PM
In response to Scheduled Tasks In ASP.NET With Quartz.Net
Hi, I've opted for this solution in one of my applications but i've found that the apppool is and I...

Michael Easterbrook 7/20/2015 4:31 PM
In response to Inline Razor Syntax Overview
When I have the following code: @foreach (var procRow in procRowDecade) { if (@procRow[3] +...

Shanice 7/18/2015 10:58 PM
In response to A Better Way To Export Gridviews To Excel
Hi. I'm working with mvc. I need to add the above code in the business logic layer, however the...

Matt 7/18/2015 6:29 PM
In response to Nested Layout Pages with Razor
Cheers sir, nice explanation :)...

Keshavan 7/17/2015 9:06 AM
In response to Scheduled Tasks In ASP.NET With Quartz.Net
Hi Mike, I have followed exactly as illustrated in blog, I get error "StdSchedulerFactory.cs" not...

Paul Thiel 7/16/2015 5:17 PM
In response to ASP.NET 5 By Numbers
Comments Below: "The new version of ASP.NET is called ASP.NET 5. It is a framework for developing...

saket singh 7/16/2015 8:42 AM
In response to Scheduled Tasks In ASP.NET With Quartz.Net
hi Mike, great tutorial on Quartz.net , but i have One Problem , Everything is working fine as as...