Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
To update this further, a workaround we have found is to set HtmlFieldPrefix to null in ViewData in every place where we use a form field.
ViewData.TemplateInfo.HtmlFieldPrefix = null;
This would seem an odd behaviour to have to override each time a form is used?
This is something with MVC helper and nothing to do with Optimizely. But you can add below in layout page or other global partial view?
ViewData.TemplateInfo.HtmlFieldPrefix = null;
So, you don't need to add it to all pages.
Hi, after migrating to CMS 12 we've noticed that the names of input elements have changed.
Where a name on a input element used to be "FirstName" we are now seeing it as "CurrentPage.AboveTheFoldContentArea.Content.Content.Content.Content.RightContent.FirstName"
Could anybody provide any insight please?
Code example
Where previously
public class TestViewModel { public string FirstName { get; set; } public string LastName { get; set; } }
with the following view
would generate the following HTML
after the upgrade we are now seeing the outputted html :
The new controller which creates the View model
public class RequestCallbackBlockController : BlockComponent<TestBlock> { protected override IViewComponentResult InvokeComponent(TestBlock currentContent) { var viewModel = new TestViewModel(); return View("TestBlock.cshtml", viewModel); } }
We are seeing the same behaviour using tag-helpers too.