New England GiveCamp 2011: What A Weekend!
Last weekend was New England GiveCamp 2011, in which 100+ developers, designers and other volunteers gathered to donate time and skills to some 30 charities who needed IT help.
This year, I was project lead for Alex’s Team Foundation, based in Andover, Mass. Our team was Saurabh Moondhra and William Wade, both experienced ASP.NET developers.
Alex’s Team Foundation, named after 16-year-old Alex Miliotis, who passed away from leukemia in 2002, raises money to support nurses and other oncology professionals, and supports youth sports. The foundation is largely the labors of Patti Rae Miliotis, Alex’s mother, and a handful of reliable volunteers. Like every small nonprofit, Alex’s Team doesn’t have a lot of money.

From the right to left: William Wade, Doug Vanderweide, Saurabh Moondhra and Patti Rae Miliotis of Alex's Team Foundation. The lady with her feet up is Deanna Lohnes, who worked on another project; the woman in green, whose name I do not know, was her charity's contact person.
Like every other leader of a small nonprofit, Patti is pulled in a lot of different directions and has all she can do to keep track of the people with whom she comes in contact, nonetheless all the donations she gets. Patti also hosts a few events every year. She basically needs a way to keep track of who attends those events or otherwise supports her organization, and to mail merge thank-you notes.
So that was the project I led this weekend: Converting a bunch of data stored in (of course!) Excel spreadsheets into a more relational database, with the ability to export that data in order to mail merge thank-you and fundraising letters.
Continue reading: New England GiveCamp 2011: What A Weekend! »
Creating An ASP.NET RSS Feed, Using Data From SQL Server And HTTP WebHandler
There are a couple of ways to create an RSS feed from a SQL database store. Over at 4GuysFromRolla.com, there’s a post explaining how to create an RSS feed using a regular old ASP.NET Web Form.
Another option would be to write a script that creates an actual XML file on some periodic basis (probably just before the recommended “time to live” setting of the feed). The benefit of that is, one taxes the database server a little every now and then, and a “real” XML file does the work.
But as a rule, for ASP.NET applications, Microsoft recommends using HTTP handlers or modules whenever one wants to present data other than HTML.
(Aside on handlers vs. modules: A handler is a special ASP.NET Web page; a module is a plug-in one can install in Internet Information Server. If you’ve got a lot of different, special-case Web processing, or one need that is near-constant — such as processing images stored in a database every time a specific page is called — then you’ll want to consider a module. For occasional or lightweight processing, such as serving up a low-use RSS stream, a handler will do fine. End of aside.)
So that’s what we’ll use here. Let’s begin by creating an ASP.NET HTTP handler, which is written in the same way one would write the code behind for an ASP.NET page, but uses the file extension .ashx.
Continue reading: Creating An ASP.NET RSS Feed, Using Data From SQL Server And HTTP WebHandler »
Getting QueryString Values From A Rewritten URL / ASP.NET Routing URL
During today’s similcast of the ASP.NET Firestarter in Atlanta, G. Andrew Duthie discussed .NET 4′s new support for routing — or, what everyone in Web development calls “URL rewriting.” *
Someone online asked, “If I use routing, can I access query string variables using JavaScript?”
The question isn’t as confused as it sounds on the surface. Of course, if one uses routing / URL rewriting, it’s to remove query string variable and make them part of what appears to be a permanent file structure.
In other words, this:
http://www.server.com/path/to/file.aspx?v1=foo&v2=bar
Becomes this:
http://www.server.com/path/to/file/v1/foo/v2/bar/
The questioner really means, is there a way, after rewriting a URL, to extract key->value pairs from it via JavaScript? The answer is yes; rather than using the location.search property, which allows JavaScript to get the querystring parameters of a URL, we use location.pathname to get the part of the URL that follows the domain, and use that to create our key->value pairs.
Continue reading: Getting QueryString Values From A Rewritten URL / ASP.NET Routing URL »
Chrome Just Isn’t Up To Firefox’s Snuff
Three weeks ago I decided to give Google Chrome
a shot at replacing Mozilla Firefox as my primary browser. And believe me, it was a fair contest: I only called upon Firefox when I could not get Chrome to work.
Unfortunately, I had to call on Firefox at least once every other day. And while I still run across the occasional Web site that requires me to use Internet Explorer — mainly, Web sites that use some Microsoft technology, such as LiveMeeting or an ActiveX control of some sort — that’s maybe once or twice a month.
(And no, I have not given IE a chance to be my primary browser. When it truly embraces Web standards, then I will consider it. Internet Explorer is barely in the neighborhood of standards compliance right now, never mind on the same street. Safari? C’mon, man. Opera? Seriously, stop now, you’re embarrassing yourself.)
So I’ve made up my mind: Chrome gets sent back to the minors to work on its skills, and Firefox — older, fatter, slower, but far more dependable and experienced — is back as my ace starting pitcher.
Custom ErrorDocuments Available For Download
After writing so much about the ASP.NET cryptographic padding oracle exploit, and the recommended workaround of a static error document, it dawned on me that I should probably make some custom error documents for my domains.
And then I decided I should share them. So, if you’re so inclined, you can download the custom error documents I use on this site. I release all code under the latest version of the GNU GPL.
I’ve created pages for 401 (unauthorized), 403 (forbidden), 404 (not found) and 500 (internal server) HTTP errors. Here’s how they look (click thumbnails for larger image):
I designed these to be valid XHTML 1.0; to appear well in all screen resolutions from 1024 x 768 and greater; and to appear the same on most Web browsers. (Of course, I exclude Internet Explorer prior to version 7 from that list.)
This little exercise also gave me a chance to play with the Google Font API. There aren’t a lot of fonts available yet, but using the API couldn’t be simpler.
Instructions on implementing custom error document on Apache can be found here. Microsoft documents how to add customError files to your ASP.NET web.config file here.
All links in this post on delicious: http://www.delicious.com/dougvdotcom/custom-errordocuments-available-for-download





