Error retrieving Form description
Hello,
I my control I use this statement:
if (!string.IsNullOrEmpty(FormName))
using (var formsManager = FormsManager.GetManager())
var formDescription = formsManager.GetForms().Where(f => f.Name == FormName).SingleOrDefault();
......
This works fine with Sitefinity 4.2.
But with Sitefinity 4.0 it gives the following error:
Hello Jaap,
Can you please let us know if FormName is the programmatic name of the form or its title that you've given when you created it? You can use the GetFormByName() method that should successfully return the form by its programmatic name:
var manager = FormsManager.GetManager();
var form = manager.GetFormByName(
"sf_myform"
);
Yes, GetFormByName solves the problem with Sitefinity 4.0.
Seems the linq query does not work fine with 4.0.
Jaap