Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I've been trying to create a basic contact form using the Code First approach. The form appears in the contour interface, but the fields are missing.
Steps:
Is there something I'm missing? Many thanks in advance.
The code so far:
using System; using Umbraco.Forms.CodeFirst; using Umbraco.Forms.Core; using Umbraco.Forms.Core.Providers; using Umbraco.Forms.Core.Providers.FieldTypes; public enum FormPages { Contact } public enum FormFieldsets { Details } [Form("Contact", MessageOnSubmit ="Thank you")] public class Contact: FormBase { [Field(FormPages.Contact,FormFieldsets.Details, Mandatory= true)] public string Name { get; set; } [Field(FormPages.Contact, FormFieldsets.Details, Mandatory = true)] public string Email { get; set; } [Field(FormPages.Contact, FormFieldsets.Details, Mandatory = true, Type = typeof(Umbraco.Forms.Core.Providers.FieldTypes.Textarea))] public string Message { get; set; } public override void Submit() { umbraco.library.SendMail( Email, "[email protected]", "New Contact", string.Format("New message from {0} : {1}", Name, Message), false); } }
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Code first form not showing fields in GUI
Hi,
I've been trying to create a basic contact form using the Code First approach. The form appears in the contour interface, but the fields are missing.
Steps:
Is there something I'm missing? Many thanks in advance.
The code so far:
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.