Configuring WCF with BasicHttpBinding and SSL

Posted on April 14, 2009

Despite a variety of posts on this topic, I had to go through a bunch of articles just to get what seemed to be a simple task.I started with this post How to setup a WCF service using basic Http bindings with SSL transport level security. The post gives a good explanation of how to get a ssl certificate and set up IIS to use the certificate. In my case, I just wanted to use SSL and not credentials. So I modified the web.config like this: ...

Read More


Getting random rows from Sql Server

Posted on February 3, 2009

I'm working on a project where I want to return related content. The sproc I wrote seems to work ok but because I was sorting by the insert date or the title, it would always return the same thing for all content closely associated.So how do I get it to return only the closely related content AND randomize it?Here is the what I did: SELECT * FROM #tmpRelated JOIN Content c ON r.ContentID = c.ContentID ORDER BY r.TotalRelevance DESC, ...

Read More


Neat way to handle Nullable types …

Posted on January 27, 2009

Ever since I read Rick Strahl's blog post on the C# ?? operator, I've been in love with the C# ?? operator. Mostly I use it as a clean way to test a ViewState variable for null in a property. For example, protected string stringToPersistOnPostBack { get { return (ViewState[this.ClientID + "_stringToPersistOnPostBack"] ?? "").ToString();< } } Somewhere along the way, the real purpose of the ?? operator was ...

Read More


Web Dev Best Practices

Posted on October 10, 2008

This has come up in various conversations recently and I was bored so I was googling for html best practices. I thought this article from Apple was quite good.

Read More


Forcing ASP .Net Validators and ValidationSummary to use CssClass

Posted on September 30, 2008

Here's something strange. If I create a validator using the following mark up: <asp:requiredfieldvalidator id="rfv_txt" runat="server" errormessage="Required" CssClass="errorText" /> and my css class is: errorText { color: purple; } My validator still renders with red text. Checking the markup, I see that ASP .Net has added an inline style attribute (style="color: red"). Obviously, inline styles take precedence over class ...

Read More