Items By Type: Tutorial

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 32122 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 30475 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 51134 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 21744 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 20644 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 93201 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 141502 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 106691 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 22690 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 21339 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 69763 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 29898 times

16 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 31579 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 39405 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 132843 times

11 Comments for this item

Recent Comments

Gayan 7/3/2015 6:20 AM
In response to 7 C# 6.0 Features That Every ASP.NET Developer Should Know About
Great Article thanks...

Semil 7/1/2015 7:03 AM
In response to iTextSharp - Drawing shapes and Graphics
I have created a rectangle using above methode. Now I want to add a text in the center of this How I...

Satyabrata Mohapatra 6/30/2015 6:12 PM
In response to Reading Excel Files Without Saving To Disk In ASP.NET
Ahh.....this is awesome. Happy to see after a long time you wrote a article on web form :D...

Marty 6/30/2015 7:16 AM
In response to Posting Data With jQuery AJAX In ASP.NET Razor Web Pages
Mike, you're the Man! Another great article. So incredibly helpful. I'm definitely going to buy your...

Rohan 6/30/2015 5:32 AM
In response to ASP.NET MVC 5 with EF 6 - Working With Files
Very good and helpful tutorial. Thanks. Just wanted to know what would be the max file size limit we...

Fernando 6/30/2015 1:59 AM
In response to Programmatically accessing data from DataSource controls
What if I want to pass parameters natively using the DataSourceSelectArguments object, instead of be...

pankaj 6/29/2015 3:13 PM
In response to How to retain carriage returns or line breaks in an ASP.NET web page
very nice i'm use this in my code thank you.... ...

Mike 6/29/2015 2:22 AM
In response to MVC 5 with EF 6 in Visual Basic - Sorting, Filtering and Paging
This is the first example that I have found that works....

Marty 6/28/2015 4:57 AM
In response to Posting Data With jQuery AJAX In ASP.NET Razor Web Pages
Mike, what if I don't want to render back the text to the browser, but I want to send it some other...

Mike 6/27/2015 4:00 PM
In response to Migrating Classic ASP To ASP.NET Razor Web Pages Part One- Razor Syntax And Visual Basic
have you used any of the code converters to convert classic asp to c#? If so, which one do you have...