fbml string.Format

Coordinator
Jul 18, 2007 at 11:54 PM
I was just playing around with some of the issues that I was running into with setFBML. I found that simply removing the string.Format( in the parameter creation solves the invalid character problem.

I don't think this will cause any problems. But, does anyone see any issues with changing these methods in this way?

public string SetFBML(string markup, string userId)
{
string results = string.Empty;

Dictionary<string, string> parameterList = new Dictionary<string, string>(3);
parameterList.Add("method", "facebook.profile.setFBML");
parameterList.Add("markup", markup);
if (!string.IsNullOrEmpty(userId))
{
parameterList.Add("uid", userId);
}
string xml = ExecuteApiCallString(parameterList, true);
if (!String.IsNullOrEmpty(xml))
{
XmlDocument xmlDocument = LoadXMLDocument(xml);

XmlNodeList nodeList = xmlDocument.GetElementsByTagName("profilesetFBMLresponse");

if (nodeList != null && nodeList.Count > 0)
{
if (nodeList0.HasChildNodes)
{
results = nodeList0.InnerText;
}
}
}


return results;
}

If not, I will post the updates.
Jul 19, 2007 at 3:13 AM
FWIW, I've been using this method w/ the string.format removed for at least 2 weeks. It's been working fine for me.
Aug 14, 2007 at 4:16 PM
I've just been trying to add some javascript (FBJS to be precise) with the latest unedited SetFBML, to my profile widget and without removing the string.Format from the markup, there's no way of getting anything with curly braces through the call. I'd suggest the string.Format is removed in the packaged release. I'm going to add a issue to this effect.
Coordinator
Sep 12, 2007 at 4:44 AM
Sounds good. We will definitely include this change in Version 1.3 that I plan to put together this week.