Archive For May 2010

Google Sitemap Generation From A Custom SiteMapResult

calendar_today 31 May 2010 20:42

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.

Rss Feed Generation From a Custom RssResult

calendar_today 31 May 2010 09:14

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.

Converting URLs Into Links With Regex

calendar_today 22 May 2010 22:56

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.

Highlighting Keywords Found In Search Results

calendar_today 22 May 2010 19:41

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.

jQuery News Scrollers and Tickers with a ListView

calendar_today 21 May 2010 21:12

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.

Displaying The First n Characters Of Text

calendar_today 16 May 2010 09:59

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.

Sessions and Shopping Carts

calendar_today 03 May 2010 23:36

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.