Items By Type: Tutorial

The Difference Between @Helpers and @Functions In WebMatrix

Sunday, March 20, 2011 9:42 AM

ASP.NET Web Pages WebMatrix Razor

This is another post which was inspired by a recent question in the ASP.NET forums, when someone asked what the difference is between @functions and @helpers in ASP.NET Web Pages. Here, I look at both of these contructs and explain what they are, how they are different, and how each should be used appropriately.

Click to read more about The Difference Between @Helpers and @Functions In WebMatrix ...

Viewed 44451 times

7 Comments for this item

Data Access Choices For WebMatrix

Saturday, March 5, 2011 10:46 PM

ASP.NET Web Pages WebMatrix

When WebMatrix was originally launched, it spurred a lot of activity from people who do not like seeing raw SQL statements in code files, or who perceived a problem working with dynamic objects. Some of these people threw their hands up in horror and tweeted or blogged their displeasure, while others felt the urge to do something about the "problem" as they saw it, and a number of open source data access projects have resulted. I've had a quick look at three projects to see what they might bring to the party.

Click to read more about Data Access Choices For WebMatrix ...

Viewed 36942 times

8 Comments for this item

Creating A Custom Template For WebMatrix

Friday, January 14, 2011 11:57 PM

ASP.NET Web Pages WebMatrix

WebMatrix includes a number of pre-built templates that you can use as a basis for developing your site, but wouldn't it be great if you could add new ones? Well, there is a way to do so, and this article looks at the steps required.

Click to read more about Creating A Custom Template For WebMatrix ...

Viewed 20910 times

2 Comments for this item

The WebGrid Helper - Making Selections

Thursday, January 13, 2011 2:08 PM

ASP.NET Web Pages WebMatrix Razor WebGrid

The WebGrid helper, introduced via ASP.NET Web Pages, provides a means for displaying tabular data easily. This article examines how to enable selection within the WebGrid at row level.

Click to read more about The WebGrid Helper - Making Selections ...

Viewed 24287 times

6 Comments for this item

Razor, Cascading Select Lists and jQuery Templates - A New Twist

Tuesday, January 4, 2011 10:20 PM

jQuery ASP.NET Web Pages WebMatrix Razor

jQuery Templates enable easy client-side generation of html. When combined with JSON data or other JavaScript objects, jQuery Templates provide a way to create a dynamic data-driven site without any server-side code whatsoever. However, in this article I will look at how they can be used to produce cascading select lists in a Razor Web Pages site.

Click to read more about Razor, Cascading Select Lists and jQuery Templates - A New Twist ...

Viewed 29897 times

4 Comments for this item

WebMatrix - URLs, UrlData and Routing for SEO

Monday, December 20, 2010 12:56 PM

ASP.NET Web Pages WebMatrix Razor

There is a certain amount of debate surrounding the importance of friendly URLs in terms of Search Engine Optimisation and improving your ranking. One thing is certain - having friendly URLs helps users to identify whether the content at the end of a link to your site is likely to be relevant to them or not. This article examines how you can make use of the built-in support for Routing provided by ASP.NET Web Pages to not only create friendly URLs, but to work with parameters as well.

Click to read more about WebMatrix - URLs, UrlData and Routing for SEO ...

Viewed 32965 times

14 Comments for this item

Nested Layout Pages with Razor

Friday, December 17, 2010 1:27 PM

ASP.NET MVC ASP.NET Web Pages WebMatrix Razor

Razor Layout pages are the equivalent to MasterPages in ASP.NET Web Forms and the Web Forms View Engine within ASP.NET MVC. Just as it is possible to nest MasterPages, it is also possible to nest Razor Layout pages. This article explores the process required to achieve nesting of Layout pages using the Razor View Engine in MVC 3, or WebMatrix Web Pages sites.

Click to read more about Nested Layout Pages with Razor ...

Viewed 111566 times

7 Comments for this item

Building Mobile Apps with WebMatrix and jQuery Mobile

Sunday, December 12, 2010 9:52 PM

jQuery ASP.NET Web Pages WebMatrix Razor

jquery Mobile was launched just a month or so ago, and is designed to make it as easy to build JavaScript-enabled web applications for mobile phones as for the desktop browser. Still in Alpha, the library has a way to go, but it already offers a rather interesting experience when used as part of a mobile phone targeted web application. Here's a first look at how to use jQuery Mobile with WebMatrix to build a mobile web application.

Click to read more about Building Mobile Apps with WebMatrix and jQuery Mobile ...

Viewed 41657 times

7 Comments for this item

WebMatrix - Testing the WebImage Helper With JCrop

Sunday, October 17, 2010 9:06 AM

jQuery ASP.NET Web Pages WebMatrix

My original JCrop article which looked at cropping uploaded images in ASP.NET has proven to be the most popular coding article I've ever written, with more views and comments than any other. Revisiting JCrop in the context of Web Pages gives me the opportunity to have a look at the WebImage helper, and see how that might make uploading and cropping images easier.

Click to read more about WebMatrix - Testing the WebImage Helper With JCrop ...

Viewed 12164 times

4 Comments for this item

WebMatrix - Working With The JSON Helper

Friday, October 15, 2010 6:51 PM

jQuery ASP.NET Web Pages WebMatrix Razor

Javascript Object Notation (JSON) is a data exchange format which really grew in popularity as AJAX libraries took off. It's lightweight and human readable, and is a great way of transferring data structures between the browser and the server. The JSON Helper was added in WebMatrix Beta 2, and this article looks at its main methods, and how they can be used.

Click to read more about WebMatrix - Working With The JSON Helper ...

Viewed 28285 times

13 Comments for this item

WebMatrix - Protecting Your Web Pages Site

Sunday, October 10, 2010 8:04 PM

ASP.NET Web Pages WebMatrix Razor

Your Web Pages site is under threat. There are people out there who want to break into restricted areas, download files they shouldn't have access to, mess up your database and steal your passwords. Worse still, they want to use your application as a gateway to the web server so that they can take full control over it. This article examines those threats and how you can protect your application against them.

Click to read more about WebMatrix - Protecting Your Web Pages Site ...

Viewed 28146 times

4 Comments for this item

WebMatrix Beta 2 Changes

Friday, October 8, 2010 7:29 PM

ASP.NET Web Pages WebMatrix

WebMatrix Beta 2 was released a few days ago, and introduced a number of breaking changes which will affect the downloadable samples in my previous articles. I'm going to update the articles and their downloads when I can, but in the meantime, here are the most important changes introduced within the newer Beta release.

Click to read more about WebMatrix Beta 2 Changes ...

Viewed 6175 times

5 Comments for this item

WebMatrix - Database Helpers for IN Clauses

Saturday, September 11, 2010 9:35 AM

Extension Method ASP.NET Web Pages WebMatrix Razor

There are times when you want to query a database for records matching a range of values, but you do not know what those values are, or even how many there are at design time. You could dynamically build your WHERE clause with multiple ORs, or you can use the SQL IN clause - except that the current database helpers in WebMatrix don't make this easy. It's about time that was fixed....

Click to read more about WebMatrix - Database Helpers for IN Clauses ...

Viewed 17101 times

10 Comments for this item

WebMatrix And jQuery Forms

Tuesday, August 10, 2010 5:23 PM

jQuery ASP.NET Web Pages WebMatrix WebGrid

Even though WebMatrix is still in its first Beta, there have been a few requests in forums already for examples illustrating how to create Web Pages forms powered by AJAX. Building on previous articles, I thought I'd put together a little sample that shows how to do this to add a record to a database using jQuery. Here's how it's done.

Click to read more about WebMatrix And jQuery Forms ...

Viewed 48747 times

12 Comments for this item

Looking At The WebMatrix WebGrid

Sunday, August 8, 2010 9:33 AM

ASP.NET Web Pages WebMatrix Razor WebGrid

One of the most useful helpers provided by ASP.NET Web Pages via WebMatrix is likely to be the WebGrid, which is designed for displaying tabular data. Still in Beta 1, documentation is sparse, so here's a more detailed look the WebGrid Helper.

Click to read more about Looking At The WebMatrix WebGrid ...

Viewed 61231 times

32 Comments for this item

Recent Comments

Gautam 11/20/2014 8:01 AM
In response to I'm Writing A Book On WebMatrix
Hello Mike, I read your book, loved it! However, I have a few request/suggestions: 1) an example...

Bret Dev 11/19/2014 8:39 PM
In response to The Difference Between @Helpers and @Functions In WebMatrix
Excellent post! One concern - where can you place global @Functions code within an MVC project to Is...

Rob Farquharson 11/19/2014 4:28 PM
In response to iTextSharp - Links and Bookmarks
How can I place text at an absolute position on the page? Also, how can I rotate text?...

Andy 11/17/2014 8:08 PM
In response to MVC 5 with EF 6 in Visual Basic - Sorting, Filtering and Paging
Hello I'm testing your sorting instructions above. This is great and I was able to get it to work...

Gautam 11/17/2014 5:51 PM
In response to WebMatrix - Database Helpers for IN Clauses
Hi Mike, I am very new to programming: In the above example if I want to use a delete button the...

donramon 11/17/2014 3:22 PM
In response to Entity Framework 6 Recipe - Alphabetical Paging In ASP.NET MVC
Congratulations on your new website look and the excellent articles. Thank you!...

Gautam 11/17/2014 11:26 AM
In response to Looking At The WebMatrix WebGrid
Hi Mike, I add the jquery script at the end of my html file.. when ajax attribute is added to the be...

Chet Ripley 11/15/2014 6:57 PM
In response to Adding A New Field
It appears the command is case sensitive. I had the same issue as Cameron. When I changed the to it...

Alvin 11/14/2014 12:49 PM
In response to Razor Web Pages E-Commerce - Adding A Shopping Cart To The Bakery Template Site
Great article Mike! When do you plan to extend the bakery shopping cart beyond this point?...

Gautam 11/14/2014 10:16 AM
In response to Web Pages - Efficient Paging Without The WebGrid
to get the count can we use only the below sql, why to join category and author table var sql =...