Submit data from the frontend

Overview

The ViewComponent framework does not support posting data from the frontend. Instead, you must make a web service call using either JavaScript or AJAX.

You can do that using the built-in Forms module to capture the data on the frontend or you can build your own custom controller to do this.

Use the built-in Forms module

Sitefinity ASP.NET Core Renderer has an out-of-the-box form functionality for submitting data to Sitefinity CMS.

The Renderer is integrated with the WYSIWYG editor for building custom forms. You can create a form using the built-in form widgets or create custom ones. Then, you place the form on a page and the form widget takes care of passing the data to the CMS.
For more information, see Create forms.

If you need some additional processing, you can intercept the form submission and attach to the CMS API IFormEntryCreatedEvent and do some processing there. 
For more information, see Forms events.

Use a custom controller 

If you do not have access to Sitefinity CMS or you want to post data to an external application, you can achieve this with a custom controller using the following process:

  1. Build your own custom controller in the ASP.NET Core Renderer.
  2. Submit your data.
  3. Use the IFormSubmissionClient to pass the data to your database or a service. 

Alternatively, you can leverage Blazor components for integrating client-side and server-side code.  
For more information, see the Blazor sample on Sitefinity GitHub repository.


Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

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.

Was this article helpful?