Hi Guys,
Need some help with some changing API's between 5.5r2 and 6.0
We have upgraded the CMS to 6.0 and it gave some error messages.
I think I have found the solution for them but would like to have your suggestions:
1.Error:
'CMS.TreeEngine.TreeNode' does not contain a definition for 'DataRow' and no extension method 'DataRow' accepting a first argument of type 'CMS.TreeEngine.TreeNode' could be found (are you missing a using directive or an assembly reference?)
Code Line:
CMSContext.CurrentDocument.DataRow["DocumentCreatedWhen"]
Solution:
CMSContext.CurrentDocument["DocumentCreatedWhen"]
Is this solution applied correct?
2.Warning:
This method is now obsolete and gives warnings
Code Line:
if(!CacheHelper.Contains(cacheItemName))
Solution:
object result = null;
if (!CacheHelper.TryGetItem(cacheItemName, out result))
Is this warning solved correctly?
3. Error:
'object' does not contain a definition for 'ToLower' and no extension method 'ToLower' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?)
Code Line:
(CMSContext.CurrentDocument.NodeCustomData["excludefromsearch"] != null ? (CMSContext.CurrentDocument.NodeCustomData["excludefromsearch"].ToLower() == "true" ? "noindex,nofollow" : "index,follow") : "index,follow")));
Not sure about the solution here. Any ideas please?
Thanks for your help in advance.
Cheers
Gitesh Shah