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

Latest Entries

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

Friday, July 9, 2010 8:28 PM

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.

Click to read more about Save And Retrieve Files From a Sql Server CE Database with WebMatrix ...

Viewed 27060 times

9 Comments for this item

WebMatrix - Consistent Look And Feel With Razor

Wednesday, July 7, 2010 10:04 PM

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.

Click to read more about WebMatrix - Consistent Look And Feel With Razor ...

Viewed 25827 times

2 Comments for this item

WebMatrix - A First Application

Tuesday, July 6, 2010 9:35 PM

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.

Click to read more about WebMatrix - A First Application ...

Viewed 43156 times

14 Comments for this item

Introducing WebMatrix - An Easier Way To Do ASP.NET

Tuesday, July 6, 2010 8:51 PM

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.

Click to read more about Introducing WebMatrix - An Easier Way To Do ASP.NET ...

Viewed 21993 times

1 Comment for this item

Classic ASP Include Files in ASP.NET

Wednesday, June 23, 2010 7:43 AM

Classic ASP ASP.NET Web Forms

Include files within classic ASP are about the only way to achieve some measure of code-reuse within frameworks that offer little or nothing by way of composition or inheritance. Judging by the number of questions in forums, there are still a lot of people moving across from classic ASP who are puzzled as to how to approach replacing include files within ASP.NET. A number of articles illustrate individually how to do so for site-wide layout reasons, including widgets, reusing global functions, or actually including the content of a file. However, I haven't been able to find one resource that brings all these together, hence the purpose of this article.

Click to read more about Classic ASP Include Files in ASP.NET ...

Viewed 111467 times

2 Comments for this item

Named Anchors And MVC Urls

Monday, June 14, 2010 10:15 AM

ASP.NET MVC

Named Anchors are used to generate links to specific locations within a web document. Unless you are careful, you may end up having a little trouble getting these to work using the MVC LinkExtension helpers.

Click to read more about Named Anchors And MVC Urls ...

Viewed 15504 times

0 Comments for this item

Google Sitemap Generation From A Custom SiteMapResult

Monday, May 31, 2010 8:42 PM

ASP.NET MVC

My previous article showed how to use a custom ActionResult and the classes within WCF to generate an RSS feed. There are no similar classes to help build a valid Google Site Map for an ASP.NET MVC application. So here's how your can build your own.

Click to read more about Google Sitemap Generation From A Custom SiteMapResult ...

Viewed 8400 times

4 Comments for this item

Rss Feed Generation From a Custom RssResult

Monday, May 31, 2010 9:14 AM

ASP.NET MVC

When I looked at producing RSS Feeds in ASP.NET MVC before, I used the ContentResult method to return XML. Best Practice suggests that you should create a new ActionResult if required. So this article looks at creating an RssResult, and a different way to generate the feed itself.

Click to read more about Rss Feed Generation From a Custom RssResult ...

Viewed 8618 times

0 Comments for this item

Converting URLs Into Links With Regex

Saturday, May 22, 2010 10:56 PM

C# Extension Method

Following on from the recent spate of extensions methods I've posted, here's another I use to convert URLs and email addresses into links within HTML. You may want to restrict users from submitting HTML tags via forms in your application, which means that URLs and email addresses that they submit appear as plain text unless they are subjected to some kind of processing.

Click to read more about Converting URLs Into Links With Regex ...

Viewed 10647 times

1 Comment for this item

Highlighting Keywords Found In Search Results

Saturday, May 22, 2010 7:41 PM

C# ASP.NET 3.5 Extension Method ASP.NET Web Forms

A common question in the forums is how to highlight key words found in search results. Here's an extension method that does that, both for partial matches, or whole word matches.

Click to read more about Highlighting Keywords Found In Search Results ...

Viewed 33072 times

6 Comments for this item

jQuery News Scrollers and Tickers with a ListView

Friday, May 21, 2010 9:12 PM

ASP.NET 3.5 jQuery

The jQuery Cycle plug-in is most often used for creating image slide shows. However, it's just as easy to use to create a news scroller from a ListView. Here, I look a doing just that. I also look at an alternative jQuery plug-in (NewsTicker) that gives the effect of the classic BBC News Ticker.

Click to read more about jQuery News Scrollers and Tickers with a ListView ...

Viewed 19713 times

1 Comment for this item

Displaying The First n Characters Of Text

Sunday, May 16, 2010 9:59 AM

C# ASP.NET 3.5 Extension Method

Displaying the first n characters of a block of text on a page without chopping words off halfway through is a common requirement. There are a number of ways to achieve this, but here's an extension method that you might find useful.

Click to read more about Displaying The First n Characters Of Text ...

Viewed 24807 times

15 Comments for this item

Sessions and Shopping Carts

Monday, May 3, 2010 11:36 PM

ASP.NET 3.5

Managing shopping carts using Sessions is the source of much confusion for beginners to ASP.NET. This article looks at how to do this so that items can be added and removed by customers easily before they commit to their purchase.

Click to read more about Sessions and Shopping Carts ...

Viewed 62689 times

12 Comments for this item

Book Review - Beginning ASP.NET 4 in C# and VB

Monday, April 19, 2010 10:24 PM

Book Review

People often post questions to the forums at www.asp.net asking what they need to learn to become an accomplished ASP.NET Web Developer. Answers vary, but tend to focus on learning the framework and a bit of SQL, along with finding your way around Visual Web Developer, or if you can afford it, Visual Studio. My answer tends to consist of the same list of items:

Click to read more about Book Review - Beginning ASP.NET 4 in C# and VB ...

Viewed 18533 times

0 Comments for this item

Validating the Contact Manager with MVC 2.0 And VS 2010

Monday, March 29, 2010 10:17 PM

ASP.NET MVC

The MVC 2.0 Framework was finally RTM'd on March 11th 2010, so I took the opportunity to update my Contact Manager application with some of its new features. While the focus of this article is validating the Model using DataAnnotations, I also touch on one or two other new features in the latest release.

Click to read more about Validating the Contact Manager with MVC 2.0 And VS 2010 ...

Viewed 16414 times

7 Comments for this item

Recent Comments

Allen Michaels 12/17/2014 4:37 PM
In response to Cascading DropDownLists with jQuery and ASP.NET
Fantastic thank you so much!...

Emily 12/17/2014 12:36 PM
In response to Parameterized IN clauses with ADO.NET and LINQ
Thanks, very helpful!!!! Can i use this for multiple in's ????? IN (.....) and IN(...) and IN...

sss 12/16/2014 3:06 PM
In response to Solving the Operation Must Use An Updateable Query error
good...

Gjuro 12/15/2014 10:30 PM
In response to Examining the Edit Methods and Edit View
You have one fromr (and it should be from, I suppose). :-)...

Gjuro 12/15/2014 10:27 PM
In response to Adding Search
Hi, thnx for all this C#->VB translations. Yet, the following code block is (slightly) in error it a...

Scot 12/14/2014 1:39 PM
In response to Entity Framework 6 Recipe - Alphabetical Paging In ASP.NET MVC
Thanks,Mike I found solution....

Gjuro 12/13/2014 10:52 PM
In response to Accessing Your Model's Data from a Controller
The article mentions "Creating an Entity Framework Data Model for an ASP.NET MVC Application" (at is...

Samuel 12/13/2014 8:40 AM
In response to Displaying The First n Characters Of Text
I have failed to use the extension because it throws an error that it doesn't recognise the chop be...

Ignas 12/12/2014 5:11 PM
In response to Cleaner Conditional HTML Attributes In Razor Web Pages
Any suggestions for Html Helper elements with HtmlAttributes, when you need to conditionally set it...

Gautam 12/11/2014 8:50 PM
In response to Validation In Razor Web Pages 2
Hi Mike Is this required for V3, non html helper input...