BeginFormSitefinity hard-codes "aspnetForm" asexpe

Posted by Community Admin on 04-Aug-2018 06:01

BeginFormSitefinity hard-codes "aspnetForm" asexpected id for webforms form tag

All Replies

Posted by Community Admin on 24-Sep-2015 00:00

I'm not sure this is a bug, but I am sure that this has been a problem for me since MVC was added to Sitefinity, and still appears to be present with 8.1. Please excuse me if this is not a bug but it sure feels like one...

It appears that the Javascript added to an MVC widget (in hybrid mvc templates) expects the main FORM tag for the page to have the specific id of "aspnetForm".

Previously, this was used to update the "action" method to match the expected action of the form when submitting. This means if you used a different ID for the main FORM on the master page, MVC widgets would not properly post to the action, but would instead post back to the page...

This appears to be averted in the current version of SF (8.1 as of now) because instead of updating the main FORM action, an entirely NEW form is created and is submitted via JavaScript. this feels even hackier than before (in my uninformed opinon of course) but does seem to alleviate the problem.

However, looking at the new markup, there is still a hard-coded reference to the FORM tag by the specific id of "aspnetForm" that appears to hook up validation.

If the FORM doesn't have this ID, am I to expect validation to fail? What is the reasoning behind using this explicit ID? Is it required that we create master pages with this id on the main form, is there a way to customize it? if this is documented that might help clear it up but as of yet I'm not able to find anything...

Any insight on this would be appreciated, if nothing else for my own curiosity. thanks

This thread is closed