Multiple MVC widgets that input data
Hi,
I am running SiteFinity 5.3. I have 2 MVC widgets that allow the user to enter search criteria to search for content on my site. On my homepage I drag and drop the widgets on to the page. So far so good. 2 search forms each with their own submit button.
However, the controller for the second widget never gets called. Regardless of which submit I click it is always the controller for the first form that gets called.
I have tried changing the form name and action parameters in the Razor code in method @BeginFormSitefinity but these seem to be ignored.
It looks like some clever JavaScript dynamically changes the action of final rendered form but I'm not sure how this works as I cannot see a form called "aspnetForm" declared on the page and is an undefined variable according to FireBug.
Can anyone offer any guidance on this please?
Thanks
var sfMvcInputs = document.getElementById("rapidBookForm222").getElementsByTagName("input");
var sfMvcInputsLen = sfMvcInputs.length;
while(sfMvcInputsLen--)
typeAttr = sfMvcInputs[sfMvcInputsLen].getAttribute("type");
if(typeAttr == "submit")
sfMvcInputs[sfMvcInputsLen].onclick = function()
document.forms["aspnetForm"].action = "/a-totally-different-page"";
document.forms["aspnetForm"].method = "GET"; // changed to post for testing purposes
document.forms["aspnetForm"].submit();
Hello,
The first controller index action is always refereed to when the controls are on one page. This is a bug here is the bug in PITS.
In the second widget if you redirect to another view the second widget will not be referring to the incorrect ActionResult.
Greetings,
Stanislav Velikov
the Telerik team