You can submit forms using an AJAX call. This way, you optimize performance, reduce traffic and server load. You do this by implementing and registering a new form submit handler. You then enable the AJAX submit functionality in the Form widget. For more information, see Form widget.
In addition, after you enable your new route form handler, you can subscribe via the EventHub to the events related to the AJAX submit call. For more information, see For developers: AJAX forms events.
RESTRICTIONS: You can use the AJAX submit functionality only when the form does not contain a Form Captcha widget. For security reasons, the Captcha validation must always be done on the server.
To implement your own route form handler, you can inherit from the default FormsSubmitRouteHandler class and provide your own logic.
FormsSubmitRouteHandler
Use the following example:
When the Forms module is initialized by the FormsModule class, the Initialize method of the module is called. As a result, a new route is registered in the Sitefinity CMS route table.
You can rewrite the default route by registering your own implementation of the FormsSubmitRouteHandler class.
To do so, you use the ObjectFactory class, which allows you to register your own implementation of the FormsSubmitRouteHandler class upon application start.
Add the following code in the Global.asax of your Sitefinity CMS application:
Global.asax
You enable the AJAX submit functionality by editing the Advanced settings of the Form widget:
NOTE: If you are using a Web Forms form, you open the widget designer's Advanced settings.
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important