Mock Ajax with FBJS

Dec 16, 2007 at 4:17 PM
Has anybody got mock ajax to work using the Facebook Developer Toolkit and FBJS?

I've tried to get the examples to work on:

without any luck. I assume I am unsuccessfully trying to convert the provided PHP code to C#/ASP.NET.

The PHP code is:

$user = isset($POST'fb_sig_user') ? $POST'fb_sig_user' : null;

if ($_GET't' == 0) { // Ajax.RAW
echo 'This is a raw string. The current time is: '.date('r').', and you are '.($user ? 'uid: #'.$user : 'anonymous').'.';
} else if ($_GET't' == 1) { // Ajax.JSON
echo 'message": "This is a JSON object.", "time": "'.date('r').'", "fbml_test": "Hello, '.($user ? '<fb:name uid='.$user.' useyou=false />' : 'anonymous').'.';
} else if ($_GET't' == 2) { // Ajax.FBML
echo 'This is an FBML string. The current time is: '.date('r').', and you are '.($user ? '<fb:name uid='.$user.' useyou=false />' : 'anonymous').'.';

Any help greatly appreciated. At present there seems to be little support/advice for using mock ajax/FBJS together with C#/ASP.NET.