A collection of articles and tutorials on web development with ASP.NET by Mike Brind

Latest Entries

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

8 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 44570 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 13497 times

5 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 31194 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 34861 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 6547 times

5 Comments for this item

Book Review - CLR Via C# Third Edition

Sunday, September 12, 2010 8:14 AM

C# General Book Review

I've had a review copy of Jeffrey Richter's CLR via C#, Third Edition for some months, and it has taken until now to get round to publishing my thoughts on the book. It's not my fault. I blame the book. It made me forget why I was given a copy in the first place. Let me explain...

Click to read more about Book Review - CLR Via C# Third Edition ...

Viewed 8804 times

1 Comment 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 22179 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 53703 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 67755 times

36 Comments for this item

Inline Razor Syntax Overview

Friday, July 30, 2010 3:27 PM

ASP.NET Web Pages WebMatrix Razor

With the launch of WebMatrix, and the announcement of the new Razor View Engine for the next version of ASP.NET MVC, here's a quick guide to Razor syntax.

Click to read more about Inline Razor Syntax Overview ...

Viewed 81025 times

11 Comments for this item

Adding And Editing Data In ASP.NET Web Pages

Sunday, July 25, 2010 9:52 AM

ASP.NET Web Pages WebMatrix

In the first of my WebMatrix articles, I mentioned that entering data via the database design forms is a bit of a pain. I also promised to look at editing data via a web page at some stage. This article keeps that promise, and looks at adding data too.

Click to read more about Adding And Editing Data In ASP.NET Web Pages ...

Viewed 21755 times

3 Comments for this item

Extending ASP.NET Web Pages - Create Your Own Helpers

Sunday, July 18, 2010 9:37 PM

ASP.NET Web Pages WebMatrix

The Beta1 version of WebMatrix comes with a number of Web Pages helpers to make your life simple. These include helpers to work with file uploading, images, email, caching, grids, Twitter feeds and a lot more. I suspect that as the product evolves towards full release, more will be added. Nevertheless, the developers of WebMatrix and Web Pages cannot anticipate every requirement, so there will be a time when you feel you need something extra. Adding your own helpers is quite easy, as this article shows.

Click to read more about Extending ASP.NET Web Pages - Create Your Own Helpers ...

Viewed 23682 times

9 Comments for this item

Web Pages - Efficient Paging Without The WebGrid

Saturday, July 17, 2010 10:48 AM

ASP.NET Web Pages WebMatrix

If you want to display your data over a number of pages using WebMatrix Beta1, you have two options. One is to use the built-in paging support that comes with the WebGrid helper. But that means that your data will be displayed within an HTML table. If that is not your preferred layout choice, you need to write your own paging code. Let's look at how you can do that.

Click to read more about Web Pages - Efficient Paging Without The WebGrid ...

Viewed 32143 times

12 Comments for this item

Finding Yesterday in SQL and C#

Monday, July 12, 2010 9:27 PM

C# SQL

Here's something that comes up often in forums - How To Find Yesterday in SQL or C#. Piece of cake, if you know how, but tricky if you don't. And especially tricky to get the right value if you are not clear on the requirement.

Click to read more about Finding Yesterday in SQL and C# ...

Viewed 16345 times

4 Comments for this item

Recent Comments

kaleem 4/16/2015 9:14 AM
In response to ASP.NET MVC, Entity Framework, One-to-Many and Many-to-Many INSERTS
hi this is very helpful ASP.NET MVC, Entity Framework, One-to-Many and Many-to-Many INSERTS if to...

cranston mason 4/16/2015 8:49 AM
In response to Managing Checkboxes And Radios In ASP.NET Razor Web Pages
How do you include a checkbox at the View module and send its values to controller to be processed?...

vamsi 4/15/2015 5:40 AM
In response to Sessions in ASP.NET 5
good article...

James Chaney 4/14/2015 8:44 PM
In response to 7 C# 6.0 Features That Every ASP.NET Developer Should Know About
Question on #5 - I don't see where this gets you out of a NullReferenceException if returns null is...

Grey 4/14/2015 6:09 PM
In response to Getting the identity of the most recently added record
Nice work....

Anh Huynh 4/14/2015 3:36 PM
In response to Create PDFs in ASP.NET - getting started with iTextSharp
I was successfully create and display PDF file from my localhost but when I move the aspx to the I...

Hisham Abdullah Bin Ateya 4/14/2015 7:00 AM
In response to Sessions in ASP.NET 5
Thanks Mike for sharing this article. George it will be nice if we let the web developers implement...

CTR 4/14/2015 6:39 AM
In response to Integrating Web API with ASP.NET Razor Web Pages
Thanks Mike, new to web pages. learning a lot from your posts, Making Ajax calls to Web API extend...

Bayu Angkasa 4/13/2015 11:27 AM
In response to The Difference Between @Helpers and @Functions In WebMatrix
Four years after you wrote it, I still find out how lucky I am to read your posts ... Thank you Mike...

abedon 4/10/2015 9:17 PM
In response to ASP.NET 5 Middleware, Or Where Has My HttpModule Gone?
I feel the title of this article is not that felicitous. ASP.NET 5 is built of top of the concept...