WebMatrix

Error Handling in ASP.NET Razor Web Pages

calendar_today 10 March 2015 13:07

ASP.NET Web Pages WebMatrix

Bang! An unhandled exception occurred during the execution of the current web request. And that's it - your visitor is met with the yellow screen of death and they are left wondering what they did wrong. You might not even be aware of what's just happened - unless your visitor can find some way of alerting you, oh, and they bother to do so. That's the problem with run time errors; the code worked fine when you ran it on your machine. But then along came a user and they tried to do something you didn't anticipate and broke your site. So what should you do about this?

Integrating Web API with ASP.NET Razor Web Pages

calendar_today 03 February 2015 13:26

ASP.NET Web Pages WebMatrix Web API

ASP.NET Web API is the recommended way to build RESTful services over HTTP when using the ASP.NET stack. This article looks at incorporating Web API into an existing Razor Web Pages site, and provides a brief introduction to Web API itself.

Using ASP.NET Identity with Razor Web Pages

calendar_today 04 July 2014 07:27

ASP.NET Web Pages WebMatrix Razor

ASP.NET Identity is the new membership system for ASP.NET applications and is the recommended system for new MVC 5 and Web Forms projects. Among other things, it moves membership away from being dependent on System.Web, which is the general direction that the next version of ASP.NET is taking. News on how the Web Pages framework will be impacted by this evolution in ASP.NET is scarce at the moment, and so is information on how to incorporate ASP.NET Identity into a Razor Web Pages site. This article demonstrates the steps required to make use of the ASP.NET Identity framework in your Web Pages application.

Migrating Classic ASP To ASP.NET Razor Web Pages Part Three- Include Files And Reusable Code

calendar_today 10 March 2014 13:23

Classic ASP VB.Net ASP.NET Web Pages WebMatrix Razor

This is the third in a series of articles that explore how to migrate classic ASP web sites to the ASP.NET Web Pages framework. I covered Razor syntax and data access in the previous articles. This article shows how to deal with reusable code that typically inhabits include files in classic ASP.

Migrating Classic ASP To ASP.NET Razor Web Pages Part Two- Data Access

calendar_today 03 March 2014 13:26

Classic ASP VB.Net ASP.NET Web Pages WebMatrix

The first article in this series explored the differences (and similarities) between classic ASP inline syntax and Razor syntax, the templating technology behind ASP.NET Razor Web Pages. The work required so far to port intermixed HTML and simple conditional and selection statements across from classic ASP to Razor didn't require a lot of effort. That is about to change in this article as I look at data access.

Migrating Classic ASP To ASP.NET Razor Web Pages Part One- Razor Syntax And Visual Basic

calendar_today 24 February 2014 13:25

Classic ASP ASP.NET Web Pages WebMatrix Razor

You have a classic ASP application that needs migrating to ASP.NET. You are comfortable working with classic ASP. but ASP.NET is fairly new to you. So what do you do? This article is the first in a series that looks at your options and proposes an approach to the migration that follows the path of least resistance.

Creating Reusable Components For ASP.NET Razor Web Pages

calendar_today 04 February 2014 19:39

ASP.NET Web Pages WebMatrix

There are a number of ways that you can maximise code re-use within a Razor Web Pages site: Layout pages, helpers, functions and so on. As you build more sites, you soon find that you are repeating code between them. You might have a collection of custom utility functions and extension methods, for example that you find yourself copying and pasting across sites. Over time, this will become a maintenance nightmare as different versions of the methods live in different sites. This article shows how to solve that problem easily by creating a library that can be shared across multiple sites.

Adding a New Row In The Razor WebGrid

calendar_today 23 January 2014 08:10

ASP.NET Web Pages WebMatrix Razor WebGrid

The Razor WebGrid isn't just used for displaying data. I have already looked at how to edit data inline within the WebGrid, so this article looks at how to add new rows of data. within a rendered grid.

Request Validation In ASP.NET Web Pages

calendar_today 18 December 2013 11:24

ASP.NET Web Pages WebMatrix Razor

Cross Site Scripting (XSS) attacks are the third on the Open Web Application Security Project's (OWASP) 2013 list of security vulnerabilities. This article looks at the defence mechanisms built into ASP.NET that protect against such attacks and how you can disable those defences in ASP.NET Razor Web Pages in a safe manner when you need to.

Check Duplicate User Names In ASP.NET Web Pages Sites

calendar_today 29 November 2013 15:22

AJAX jQuery ASP.NET Web Pages WebMatrix Razor

The Web Pages Starter Site template provides a useful starting point for developing a Razor Web Pages site that includes membership. But it doesn't include any mechanism for preventing duplicate user names. This article offers one solution to the problem that uses jQuery.

Posting Data With jQuery AJAX In ASP.NET Razor Web Pages

calendar_today 06 November 2013 19:38

AJAX jQuery ASP.NET Web Pages WebMatrix Razor

There have been a few questions recently about what you can post to the server using jQuery AJAX and where to find whatever you posted. This article looks at using the jQuery ajax method in ASP.NET Razor Web Pages and explores how different options have different results.

Saving jQuery Sortables In ASP.NET Razor Web Pages

calendar_today 28 October 2013 20:04

jQuery ASP.NET Web Pages WebMatrix Razor

jQuery Sortables offer a way to specify the order of a collection of items through an easy drag and drop interface. I have just been working on the next release of Web Pages CMS and am in the process of implementing Sortables for managing the display order of menu items. This article looks at how they can be used in Razor Web Pages and shows one way of saving the resulting order to a database.

Managing Checkboxes And Radios In ASP.NET Razor Web Pages

calendar_today 14 October 2013 21:04

ASP.NET Web Pages WebMatrix Razor

Checkboxes and radio buttons cause more confusion than any other form control in ASP.NET Razor Web Pages. This article takes an in depth look at them and tackles the most frequently asked questions that they generate.

Code First Migrations With ASP.NET Web Pages Sites

calendar_today 28 August 2013 20:14

Visual Studio Entity Framework ASP.NET Web Pages WebMatrix

Entity Framework Code First Migrations enable changes to your model to be propagated to your database through code. Prior to the introduction of migrations, changes to the model resulted in the database being recreated from scratch with attendant loss of data. During development, this may not cause too many problems, but once the database has been deployed into production, it's another story. Migrations solve the problem in that changes are applied to the database schema without loss of data.

Windows Authentication With ASP.NET Web Pages

calendar_today 07 August 2013 19:34

ASP.NET Web Pages WebMatrix

The default authentication mechanism built into ASP.NET Web Pages site templates is Forms Authentication via the SimpleMembershipProvider, which is designed to enable authentication of users against a database. This requires the user to know their user name and password, and to enter those whenever they want to log in to access restricted areas within a site. If you are using the ASP.NET Web Pages framework to build an Intranet site that will be hosted within your own corporate network (i.e. client machines and web server are in the same domain), you can use Integrated Windows Authentication instead which simplifies authentication dramatically.

Implementing Customers Also Bought In ASP.NET Web Pages

calendar_today 01 August 2013 15:32

ASP.NET Web Pages WebMatrix Razor

Most successful e-commerce sites implement a mechanism that draws the customer's attention to other products that might be of interest to them. These products are selected on the basis that shoppers who purchased the item currently being viewed by the customer also bought other products. This article looks at a away of implementing this kind of facility in an ASP.NET Web Pages site.

How To Check If A Query Returns Data In ASP.NET Web Pages

calendar_today 03 July 2013 14:01

ASP.NET Web Pages WebMatrix Razor

If you execute a query against a database, you need to know if any data was returned. But what is the best way to test for the presence of data when using the Web Pages Database helper?

Web Pages CMS Launched

calendar_today 07 June 2013 14:55

ASP.NET Web Pages WebMatrix

Earlier this week, I released the first version of Web Pages CMS - a content managment system that has been built using the ASP.NET Web Pages framework. The project is being hosted at CodePlex, and version 0.5.0.1 is available as a download. I also launched an accompanying web site that provides documentation for the project at www.webpagescms.com.

A CKEditor File Browser For ASP.NET Web Pages

calendar_today 16 May 2013 14:00

ASP.NET Web Pages WebMatrix Razor

CKEditor is one of the most popular rich text editors available. Out of the box, there is no file browser to help with selecting images, but you can purchase an add-on from them - CKFinder. Alternatively, you can build your own file browser component.

Adding A Footer To The Razor WebGrid

calendar_today 25 February 2013 19:43

ASP.NET Web Pages WebMatrix Razor WebGrid

Whether you are using the Razor WebGrid in an ASP.NET Web Pages site, or an MVC application, you may well want to display tabular data at some point in which case you are likely to turn to the Razor WebGrid helper. And if you want to do that, you might also want to add a footer to the rendered table. Here are some ways that you can accomplish that task.

Razor Web Pages E-Commerce - Adding A Shopping Cart To The Bakery Template Site

calendar_today 15 February 2013 19:31

ASP.NET Web Pages WebMatrix Razor

The ASP.NET Web Pages Bakery template site is designed as a starting point for a site that displays products. It also features an order form for customers to specify a quantity for a specific product and provide their shipping address. The site doesn't provide for multiple product selection. If you want a shopping cart for the Bakery site, you need to create it yourself. This article looks at the design considerations behind an effective shopping cart, and shows how to build one.

Consuming Feeds And Web Services In Razor Web Pages

calendar_today 05 February 2013 19:55

ASP.NET Web Pages WebMatrix

Increasing numbers of businesses are making services and data available to third parties via Web Services or feeds. Data format and protocols can vary significantly across service providers, so here is a look at how to manage the consumption of a number of popular formats delivered through REST and SOAP services within a web site built using the ASP.NET Web Pages framework.

Practical Recursion in ASP.NET Web Pages with WebMatrix

calendar_today 22 January 2013 14:44

ASP.NET Web Pages WebMatrix Razor

Recursive methods are those that call themselves, and they can be applied to solve a number of common practical problems, particularly ones that involve the management and display of hierarchical data. This article explores some of those scenarios and shows how to design recursive helpers and functions that can be used in Web Pages sites.

Exporting The Razor WebGrid To Excel Using OleDb

calendar_today 07 January 2013 20:38

ASP.NET Web Pages WebMatrix WebGrid

This article looks at how you can provide your users with the ability to export the contents of a Razor Web Pages WebGrid to an Excel file using OleDb.

SignalR And Knockout In ASP.NET Web Pages Using WebMatrix

calendar_today 27 December 2012 20:17

ASP.NET Web Pages WebMatrix Razor

SignalR is a library that simplifies the creation and management of persistent connections between web servers and clients. This facilitates the development of applications that can display updates to data held on the server in real-time. Chat applications are the most obvious beneficiaries of this technology, but line-of-business applications that need to report availability to users can benefit too. Here, I look at extending the canonical SignalR chat example to incorporate a "who's typing" feature, and I also extend my previous Knockout example to use SignalR.

Exporting The Razor WebGrid To PDF Using iTextSharp

calendar_today 20 December 2012 13:31

iTextSharp ASP.NET Web Pages WebMatrix Razor WebGrid

This article looks at how you can provide your users with the ability to export the contents of a Razor Web Pages WebGrid to a PDF file using the popular free PDF library, iTextSharp.

Exporting The Razor WebGrid To Excel

calendar_today 17 December 2012 20:17

ASP.NET Web Pages WebMatrix Razor WebGrid

This article looks at how you can provide your users with the ability to export the contents of a Razor Web Pages WebGrid to an Excel file.

Enhancing The WebGrid With Sort Arrows

calendar_today 14 December 2012 19:24

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.

Inline Editing With The WebGrid

calendar_today 13 November 2012 10:37

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.

Cleaner Conditional HTML Attributes In Razor Web Pages

calendar_today 23 October 2012 21:27

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.

The SimpleMembershipProvider, Secure Passwords And The Crypto Helper

calendar_today 27 September 2012 13:39

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?

HTML5 Form Helpers For WebMatrix

calendar_today 20 September 2012 14:56

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.

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

calendar_today 18 September 2012 08:08

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.

Optimising ASP.NET Web Pages Sites - Bundling And Minification

calendar_today 15 September 2012 17:05

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.

WebMatrix - jQuery Cascading Dropdown Lists

calendar_today 08 September 2012 09:56

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.

ASP.NET Web Pages - Creating Custom Validators

calendar_today 31 August 2012 14:33

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.

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

calendar_today 22 July 2012 20:46

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.

Transferring Data Between ASP.NET Web Pages

calendar_today 14 July 2012 20:24

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.

Validation In Razor Web Pages 2

calendar_today 14 June 2012 12:47

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.

Using Knockout With Razor Web Pages In WebMatrix 2

calendar_today 09 June 2012 11:40

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.

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

calendar_today 03 June 2012 10:30

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.

More Flexible Routing For ASP.NET Web Pages

calendar_today 01 February 2012 21:52

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.

Using The Themes Helper In Razor Web Pages

calendar_today 02 January 2012 18:31

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.

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

calendar_today 30 December 2011 15:25

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.

HTML Helpers For Forms In Razor Web Pages

calendar_today 25 December 2011 11:27

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.

Globalization And Localization With Razor Web Pages

calendar_today 10 October 2011 21:35

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.

Entity Framework Code First Development With WebMatrix

calendar_today 05 September 2011 17:27

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.

The WebGrid - Efficient Paging And Sorting With SQL CE 4.0

calendar_today 28 August 2011 22:46

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.

Displaying Search Results In A WebGrid

calendar_today 27 August 2011 16:57

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

A number of people have run into problems when trying to combine a search or filter form, and a WebGrid. The main issue that arises is when paging or sorting the search result or a filtered subset of it. Here, I look at the cause of the problem and what you can do about it.

How To Maintain Scroll Position When Paging Or Sorting A WebGrid

calendar_today 23 August 2011 21:13

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

This snippet is one in a series showing how to use jQuery to enhance the behaviour of a Web Pages WebGrid. This example shows how to maintain scroll position on the page when paging or sorting the WebGrid.

How To Make A WebGrid Row Clickable

calendar_today 23 August 2011 11:23

jQuery ASP.NET Web Pages WebMatrix Razor WebGrid

This snippet is one in a series showing how to use jQuery to enhance the behaviour of a Web Pages WebGrid. This example shows how to make an entire row clickable so that the user is taken to another page that displays details of the selected row.

jQuery Autocomplete with Razor Web Pages and a SQL CE Database

calendar_today 16 August 2011 09:23

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.

WebMatrix and jQuery Forms Part 2 - Editing Data

calendar_today 06 August 2011 17:33

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.

WebMatrix Opens Wrong Version Of Visual Studio

calendar_today 01 May 2011 08:56

Visual Studio WebMatrix

A number of people have complained that clicking the Visual Studio Launch button in WebMatrix opens an older version of Visual Studio instead of the latest version. There is an easy fix to this.

Generating RSS and ATOM Feeds In WebMatrix

calendar_today 12 April 2011 12:36

ASP.NET Web Pages WebMatrix Razor

I've previously looked at how to generate RSS feeds for both Web Forms and MVC using a variety of techniques, so it is only right that I look at a couple of ways to do this in Web Pages - the Razor based web development model supported by WebMatrix.

The Difference Between @Helpers and @Functions In WebMatrix

calendar_today 20 March 2011 09:42

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.

Data Access Choices For WebMatrix

calendar_today 05 March 2011 22:46

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.

Why You Can't Use Extension Methods With A WebGrid

calendar_today 27 January 2011 12:58

Extension Method ASP.NET Web Pages WebMatrix WebGrid

An interesting question came up recently on the ASP.NET forums. In it, the questioner was attempting to use my Chop() extension method to limit the number of characters in a WebGrid column but it wouldn't work. At first, I was a little stumped, so I tried it myself and got an error message:

I'm Writing A Book On WebMatrix

calendar_today 18 January 2011 19:27

ASP.NET Web Pages WebMatrix

Yes - it's official! I'm writing a book for Wiley all about Microsoft's new stack for beginner web developers - WebMatrix.

Creating A Custom Template For WebMatrix

calendar_today 14 January 2011 23:57

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.

The WebGrid Helper - Making Selections

calendar_today 13 January 2011 14:08

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.

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

calendar_today 04 January 2011 22:20

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.

WebMatrix - URLs, UrlData and Routing for SEO

calendar_today 20 December 2010 12:56

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.

Nested Layout Pages with Razor

calendar_today 17 December 2010 13:27

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.

Building Mobile Apps with WebMatrix and jQuery Mobile

calendar_today 12 December 2010 21:52

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.

WebMatrix - Testing the WebImage Helper With JCrop

calendar_today 17 October 2010 09:06

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.

WebMatrix - Working With The JSON Helper

calendar_today 15 October 2010 18:51

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.

WebMatrix - Protecting Your Web Pages Site

calendar_today 10 October 2010 20:04

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.

WebMatrix Beta 2 Changes

calendar_today 08 October 2010 19:29

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.

WebMatrix - Database Helpers for IN Clauses

calendar_today 11 September 2010 09:35

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....

WebMatrix And jQuery Forms

calendar_today 10 August 2010 17:23

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.

Looking At The WebMatrix WebGrid

calendar_today 08 August 2010 09:33

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.

Inline Razor Syntax Overview

calendar_today 30 July 2010 15:27

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.

Adding And Editing Data In ASP.NET Web Pages

calendar_today 25 July 2010 09:52

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.

Extending ASP.NET Web Pages - Create Your Own Helpers

calendar_today 18 July 2010 21:37

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.

Web Pages - Efficient Paging Without The WebGrid

calendar_today 17 July 2010 10:48

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.

Save And Retrieve Files From a Sql Server CE Database with WebMatrix

calendar_today 09 July 2010 20:28

ASP.NET Web Pages WebMatrix Razor

A perennial choice that web developers have to make is whether to store uploaded files to the file system or a database. Each method has its pros and cons, and the debate over which approach is best continues to rage. This article will not add to the noise. It will simply demonstrate how to upload files to the Sql Server CE database which is the default option in Web Pages, and how to retrieve them for users again.

WebMatrix - Consistent Look And Feel With Razor

calendar_today 07 July 2010 22:04

ASP.NET Web Pages WebMatrix Razor

Most web development frameworks provide features that assist with creating a consistent look and feel across pages, or make provision for managing reusable partial content, such as headers and footers. The Web Pages framework is no exception. This article examines the core features offered by its Razor view engine for handling templated layouts and common blocks of content.

WebMatrix - A First Application

calendar_today 06 July 2010 21:35

ASP.NET Web Pages WebMatrix

This article will take a first look at WebMatrix - Microsoft's new IDE for developing Web Pages applications. In it, I will cover a number of the core features that will make Web Matrix the ideal starter's web development framework as I create a very simple application.

Introducing WebMatrix - An Easier Way To Do ASP.NET

calendar_today 06 July 2010 20:51

ASP.NET Web Pages WebMatrix

There has been a spate of announcements recently from Scott Guthrie, the main Microsoft man responsible for ASP.NET over the last week or so - the launch of IIS Express, a new version of SQL Server Compact Edition (CE) that can be run in medium trust environments, and a new View Engine and syntax called Razor. Each of these announcements have generated a lot of reaction, and they are each significant in themselves. They all make ASP.NET easier for existing developers. However, if you put them all together, and throw in a new framework and IDE, they make ASP.NET much, much easier for new developers coming to ASP.NET for the first time. So that's what Microsoft have gone and done. And today, they have announced the first Beta version of WebMatrix - a head-on competitor to WAMP stacks.