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.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

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.

Web Security for Sitefinity Administrators

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.

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?

Next article

.NET Core samples