We are new to the Umbraco tool and created a registration form using Html and script. Once registration form submitted email getting sent but data is not stored in the database. Firstly which database table we should verify for the form submitted data. secondly do we need to make any settings to store the submitted data.
Any help will be appreciated.
Under the templates ->create a new template(Registration) and wrote the HTML markup to create the page, also the business logic.
Please find attached the code.
Can you please let me if any settings/code need to be added, so that it saves the data to the table.`@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using System.Collections.Generic;
@using System.Text;
@using System.Net.Mail;
@{
Layout = "Master.cshtml";
var content = CurrentPage;
var offices = content.Children("OfficeLocation").Where("Visible");// content.GetChildren
HttpContext context = HttpContext.Current;
string errorMsg = "";
string emailTo = "";
try
{
if (context.Request.Form.Count > 0)
{
if(context.Session["captchaString"].ToString().ToLowerInvariant() != context.Request.Form["captchainput"].ToString().ToLowerInvariant())
{
errorMsg = "<p>Please enter the characters in the image below to verify your submission</p>";
}
StringBuilder sb = new StringBuilder();
contactType = context.Request.Form["contacttype"];
string firstName = context.Request.Form["firstname"];
string lastName = context.Request.Form["lastname"];
string title = context.Request.Form["title"];
string emailFrom = context.Request.Form["email"];
string phone = context.Request.Form["phone"];
string location = context.Request.Form["location"];
string company = context.Request.Form["company"];
string username = context.Request.Form["username"];
string password = context.Request.Form["password"];
string message = context.Request.Form["message"];
//send an email logic
// Redirect to thank you page
}
catch (Exception ex)
{
errorMsg = "<p>" + ex.Message + "</p>";
}
Form values are not getting stored in Database
We are new to the Umbraco tool and created a registration form using Html and script. Once registration form submitted email getting sent but data is not stored in the database. Firstly which database table we should verify for the form submitted data. secondly do we need to make any settings to store the submitted data. Any help will be appreciated.
Hi Swarna
Can you show the code of form?
Thanks,
Alex
Under the templates ->create a new template(Registration) and wrote the HTML markup to create the page, also the business logic. Please find attached the code. Can you please let me if any settings/code need to be added, so that it saves the data to the table.`@inherits Umbraco.Web.Mvc.UmbracoTemplatePage @using System.Collections.Generic; @using System.Text; @using System.Net.Mail; @{ Layout = "Master.cshtml"; var content = CurrentPage; var offices = content.Children("OfficeLocation").Where("Visible");// content.GetChildren
} @section bodyEndAfterScripts {
}
@if (content.HeaderImage != null && content.HeaderImage > 0) { }
@content.ContentTitle
@content.SubTitle
@Html.Raw(content.TopContent)Hi Swarna
Please, fix the code
is working on a reply...