Posting Data to Existing Server Database?
Hi,
I am fairly new with Sitefinity and currently preforming an internship (Web Development) with my University.
I am looking for documentation, or guidance on the following:
Any help would be greatly appreciated.
Thanks,
Michael
Hello Michael,
Could you please elaborate on what you want exactly to achieve? If you want to export some content items from Sitefinity to the external database, you should implement some extensibility points in your application to which to hook from Sitefinity. You can implement a completely custom solution using services to pass data from and to you external application. If you want more Sitefinity dedicated solution you can create inbound and outbound pipe using the Publishing system described in details in our documentation.
Regards,
Nikola Zagorchev
Telerik
[quote]Could you please elaborate on what you want exactly to achieve?[/quote]
Okay here is the problem.Currently the university uses Javascript to validate the information in the forms there using and upon validation, they use a vb script to post data to a database on campus.
What I have resorted to is this so far:
using System;
using System.ComponentModel.DataAnnotations;
using System.Linq;
namespace SitefinityWebApp.Mvc.Models
public class simpleForm01Model
public bool IsSubmitted get; set;
public string Name get; set;
public string Email get; set;
using System;
using System.ComponentModel;
using System.Linq;
using System.Web.Mvc;
using Telerik.Sitefinity.Mvc;
using SitefinityWebApp.Mvc.Models;
namespace SitefinityWebApp.Mvc.Controllers
[ControllerToolboxItem(Name = "simpleForm01", Title = "simpleForm01", SectionName = "MvcWidgets")]
public class simpleForm01Controller : Controller
public ActionResult Index()
var model = new simpleForm01Model();
return View("Default", model);
[HttpPost]
public ActionResult Index(simpleForm01Model model)
if (ModelState.IsValid)
model.IsSubmitted = true;
return View("Default", model);
@using Telerik.Sitefinity.UI.MVC
@model SitefinityWebApp.Mvc.Models.simpleForm01Model
@if (Model.IsSubmitted)
<
p
>
Thanks for submitting the form!
</
p
>
else
using (Html.BeginFormSitefinity())
<
p
>
@Html.EditorForModel()
</
p
>
<
input
type
=
"submit"
value
=
"Sumbit Request"
/>
This is my view that I have.
From here, I have no clue how to validate this or send it from here to a script with a connection string to post to an external db. The idea is that once I get a grasp of this simple form that I will be migrating/creating new forms for the university through Sitefinity(MVC).
Hi Michael,
Do you have any endpoints implemented in your other application, through which you can create items? Do you have some kind of RESTful services or other way you can communicate with the other application and post items?
Another option is to use our alternative publishing system and the RSS feeds and create items based on the feed in your other application. More information could be read here.
However, based on what you have provided as information and code blocks, I believe that using Services will be the best approach in your scenario, since you want to save only specific content submitted using an MVC widget and not content items from an entire module.
Regards,
Nikola Zagorchev
Telerik