Thursday, 25 June 2009

In ASP.NET 3.5 a GridView has built in paging, which is nice, and a DataList has a RepeatColumns property so you can display data in columns as well as rows. But, wouldn't it be cool to have a databound control that has both features? Well, you can.

To turn something that looks like this:

1
2
3
4
5
6
7
8
9
Next >

..into something that looks like this:

1 2 3
4 5 6
7 8 9
Next >

..use a GridView and a bit of code behind.



Share this webpage Comments on this webpage

Monday, 20 April 2009

The blog system I'm using has a Twitter widget that can be added to pages to show your latest tweets. I wasn't quite happy with it so here's a simple Twitter status ASP.NET user control that I put together using LINQ to XML and VB.NET.

The control gets the two latest tweets and caches them for 60 seconds. Just change the .Take(2) line in the LINQ if you want more or less tweets and the OutputCache tag if you want more or less caching. There's a VB.NET function to add hyperlinks to URLs and usernames and a Javascript function to format the time of tweets.

Here's the .ascx file:



Share this webpage Comments on this webpage