how to save response of contact form request in cms?

Muhammad Kaleem asked on May 2, 2019 07:15

i'm using kentico12 mvc, i have created a HTML form in my contact page, i want to save its response in cms forms application can anyone suggest me please how is it possible? when user submits the form which event should be call and how to post form data in cms,any help will be highly appreciated...

thanks

Correct Answer

Dmitry Bastron answered on May 2, 2019 11:01

Hi Muhammad,

Is it your custom HTML form with custom controller for it and you just want to store the submitted data in Kentico Forms app? If so, then you'd need to:

  1. Create a new Kentico form replicating the fields you want to store Image Text

  2. Generate the code for this form object Image Text

  3. In your custom controller form post action create a new form object, populate the fields and save

    var form = new DancingGoatMvcContactUsNewItem
    {
        UserFirstName = "Firstname",
        UserLastName = "Lastname",
        UserEmail = "Email",
        UserMessage = "My message"
    };
    form.Insert();
    

Hope it will help!

1 votesVote for this answer Unmark Correct answer

Recent Answers


David te Kloese answered on May 2, 2019 10:31 (last edited on May 2, 2019 10:31)

Lee Conlin posted a bit more advanced article about using Kentico Forms in MVC a few weeks ago that might get you in the right direction :

medium.com/.../using-forms-in-kentico-12-mvc-without-the-page-builder

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.