Query form description of form using current culture

Posted by Community Admin on 04-Aug-2018 12:59

Query form description of form using current culture

All Replies

Posted by Community Admin on 28-Sep-2016 00:00

Hi,

I have created a mvc form in two languages in Sitefinity backend (Sitefinity 9.1). Now i need to create a mvc custom widget in visual studio. I want to display the form description based on the current culture in the front end. 

 var currentCulture = Thread.CurrentThread.CurrentUICulture.Name;
 var formManager = FormsManager.GetManager();
 return formManager.GetForms().Where(f => f.Name == FormName &&  f.AvailableCultures.Contains(new CultureInfo(currentCulture))).SingleOrDefault();

But its throwing error saying parameter not found.

Please help.

 

 

 

This thread is closed