Copied to clipboard

Flag this post as spam?

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


  • Dan Waters 10 posts 30 karma points
    Sep 24, 2013 @ 13:17
    Dan Waters
    0

    How do you create multiple form steps with code first?

    Hi there!

    I want to be able to 1) upload a file and 2) do something with the data from it in a separate form step, all in a code first form.

    So my first step would be to upload (and validate) the file, and then the second page would set up some prevalues based on what's in the file and allow the user to manipulate some things before saving.

    Problem is I have no idea how to do this with code first, is there an example somewhere that I'm missing? I understand my entities are basically forms and fields... how do I express the form steps in code?

    Thanks,

    Dan

  • Dan Waters 10 posts 30 karma points
    Sep 24, 2013 @ 13:33
    Dan Waters
    0

    I figured it out. Have an enum with the steps (Pages)

    public enum FormPages
    {

    PageOne = 1,

    PageTwo = 2,

    // etc.

    }

    Then mark the fields as appropriate.

    [Field(FormPages.PageOne, ... etc)]
    public string Username { get; set; } 

    This was not clear to me from the docs but it does work.

  • Dan Waters 10 posts 30 karma points
    Sep 24, 2013 @ 23:26
    Dan Waters
    0

    Here's another quick question: I want the file to be uploaded in the first step, but I don't want to submit the whole thing. Is there a way to accomplish this? I need the file uploaded for the second step.

  • Comment author was deleted

    Sep 30, 2013 @ 13:05

    Yeah contour will perform the upload in the first step

Please Sign in or register to post replies

Write your reply to:

Draft