restserver.php gets called ever time

Jan 1, 2009 at 10:14 PM
I'm using the 2.0 framework and I must be doing something wrong because in fiddler I can see the restserver.php (that's the page that returns the xml document with all facebook info) gets called three times with this example.  Shouldn't it only get called once?
in my default.aspx page I do this.

Hello, <%= API.users.getInfo().name %>
your users name uid is <%= API.users.getInfo().uid %>
and one more time for fun <%= API.users.getInfo().uid %>

Jan 1, 2009 at 11:07 PM
Your calling the API 3 times so it will do 3 calls

try something like:

<%
facebook.Schema.user userinfo = API.users.getInfo();    
string name = userinfo.name;
string  userid = userinfo.uid.tostring();
Response.Write("Hello, \"" + name + "\",<br/>Your users name uid is: \"" + userid + "\".<br/>And one more time for fun  " + userid + " <br/>");
%>

I havn't tested it but it should work.

Paul


Jan 2, 2009 at 12:01 AM
thanks. that makes sense.