Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jay Walker 10 posts 38 karma points
    Jul 27, 2017 @ 13:25
    Jay Walker
    0

    Umbraco 7.6.4 Visual Studio 2017 - Where to add custom code for Workflow, Models, Controllers

    I'm struggling to determine where to place my custom c# code under a Visual Studio 2017 umbraco 7.6.4 project for Workflow, Models, Controllers.

    Local Environment:

    • Win7, IIS7.5, VS2017, Sql Server 2014.
    • Creating a new 'ASP.NET Web Application (.NET Framework) 4.5.2' as an empty Template - with no folder references for MVC or Web Forms.
    • Then I pull Umbraco from nuget Install-Package UmbracoCms -Version 7.6.4
    • Configure Umbraco to use a local Sql Server 2014 db with Integrated Authentication

    Then I build / run and the site works fine.

    Issues:

    1. I need to capture some sensitive data and would like to create a custom Umbraco Forms Workflow so I can encrypt the data and prevent it from being saved in default plain text manner. I can't figure out where I put my c# code so that the workflow becomes available in the workflow.
    2. I've also tried to add a custom model and custom controller to try to roll my own form but have received errors - either that the model or controller get created twice or have multiple routes (when I put in App_Code) or that the Model isn't found by the .cshtml file.

    Starting Point in VS enter image description here enter image description here enter image description here

    Any help would be appreciated!

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Jul 27, 2017 @ 14:14
    Alex Skrypnyk
    0

    Do not use App_Code if you are using Web Application project type.

    Use Controllers, Models and any folders you want, all c# code will be compiled to dll.

  • Jay Walker 10 posts 38 karma points
    Jul 27, 2017 @ 17:53
    Jay Walker
    0

    Alex, Thank you for your reply. I'm confused on the best starting point. Should I use a default Web Application as described in this install guide (http://www.paulrgriffiths.co.uk/blog/installing-umbraco-7-part-1-setting-up-visual-studio/) or start with an asp.net MVC project?

    As a test I was just able to create an App_Code folder and placed a Model and Controller in it and updated a Template and Partial View per these instructions and was able to see the form rendered to the page. (https://github.com/kgiszewski/LearnUmbraco7/blob/master/Chapter%2007%20-%20Forms/01%20-%20Integrating%20Umbraco%20with%20MVC%20Forms.md)

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Jul 28, 2017 @ 14:27
    Alex Skrypnyk
    100

    Hi Jay

    I like to use an empty web application, MVC will be installed with Umbraco via nuget, it's easy.

    Thanks,

    Alex

  • Ajju 25 posts 148 karma points
    Mar 06, 2018 @ 09:36
    Ajju
    0

    Mr. Alex,

    I have a Published version of Umbraco (7.4.2) from a client to add / modify some additional features over it.

    Could you suggest how to proceed without the actual source code. For Instance, I need to modify a form by adding a new field and make it work with the existing form.

    Is that possible as above or I should recreate the complete form.

    Thanks

  • Alex Skrypnyk 6175 posts 24186 karma points MVP 8x admin c-trib
    Mar 06, 2018 @ 09:38
    Alex Skrypnyk
    0

    Hi Ajju

    The way to do it - download all the files and open the site as Website in visual studio, and you are able to work with all the code that isn't compiled to dll. Usually, it's enough for making a lot of changes, but of course better to have full source code

    Alex

  • Ajju 25 posts 148 karma points
    Mar 07, 2018 @ 12:49
    Ajju
    0

    Thanks Mr. Alex,

    I need to modify a form by adding new fields and make it work with the existing form. Is that possible as above or I should recreate the complete form from beginning. Forms are developed using MVC Code and not umbraco forms

    I am very new to Umbraco and .NET platform.

Please Sign in or register to post replies

Write your reply to:

Draft