Check out this great tool. It helps you paste in C# code and formats it to HTML. And it's free.