C# Razor | Dump Request.Form Data to Table

So I have recently been weaning myself off ColdFusion to another coding language. I am really liking what I am seeing in C# Razor tags. It has the same general workflow as Coldfusion without the need for an expensive application server.

Anyways in Coldfusion there was <cfdump var=#VarName#> which would spit out a wonderful  table of all the variable elements.  I was dumbstruck to find out there is no such native functionality in C# / C# Razor.

I wrote this to do the exact same thing. Enjoy! 

@{int i = 0;}
            <td>Field Name</td>
            <td>Field Data</td>
    @foreach (var fd in Request.Form.AllKeys) {


Leave a Reply

Your email address will not be published. Required fields are marked *