MVC – how to debug what your form is Posting

MVC is the new battleground for .net based Content Management Systems. Umbraco use it, Sitecore use it. So debugging is essential for finding head and tail in sometime illogical code behaviours.

I like to use Firebug Console to quickly check what my forms are POSTing back to my. Controller.

You can start by finding your Form with jQuery syntax and a bit of javascript wizardry

if there is only one form on your page, type following in the console window.

$('form').serialize()

if there more then one use the array of elements returned by jQuery to find your form.

$($('form')[1]).serialize()

The form is highlighted by the Firebug, so you know when you have found it.
Happy coding  (c:

Advertisements

One Response to MVC – how to debug what your form is Posting

  1. cozycoding says:

    You may want to try Fiddler2 (for Windows) – http://www.fiddler2.com/fiddler2/ . Requires no setup and just catches all transactions between your browser and the servers. Allows you to get details about all the requests, including post data.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: