Skip to content

Instantly share code, notes, and snippets.

@fraabye
Created June 25, 2015 10:06
Show Gist options
  • Select an option

  • Save fraabye/c4762908bfb0eaf9774a to your computer and use it in GitHub Desktop.

Select an option

Save fraabye/c4762908bfb0eaf9774a to your computer and use it in GitHub Desktop.
Get Umbraco Forms current record data on submit
@if (TempData["umbracoformsform"] != null && TempData["Forms_Current_Record_id"] != null)
{
var currentForm = (Umbraco.Forms.Mvc.Models.FormViewModel) TempData["umbracoformsform"];
var currentRecordId = TempData["Forms_Current_Record_id"].ToString();
var recordIdGuid = new Guid(currentRecordId);
var recordSet = Library.GetRecordsFromForm(currentForm.FormId.ToString());
foreach (dynamic record in recordSet)
{
try
{
if (record.UniqueId == recordIdGuid)
{
<div>
<ul>
<li>Created:: @record.Created</li>
<li>Form:: @record.Form</li>
<li>Id:: @record.Id</li>
<li>IP:: @record.IP</li>
<li>MemberKey:: @record.MemberKey</li>
<li>State:: @record.State</li>
<li>UmbracoPageId:: @record.UmbracoPageId</li>
<li>Updated:: @record.Updated</li>
<li>UniqueId:: @record.UniqueId</li>
</ul>
</div>
}
}
catch (Exception e)
{
<div>@e.Message</div>
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment