Create a web form generator

Asked

Viewed 354 times

2

I need to create a web form generator, ie create the form, fields, validations, CSS so that this structure goes to a data repository and when consulting the structure mount on the screen the form.

Does anyone have any idea which technology is best to create a project like this?

  • Senbores, I would like to make a Formulary generator http://www.wufoo.com/ I don’t think I expressed myself well in my initial question.

1 answer

2

Yeah. It’s called Scaffolding.

The Visual Studio has Scaffolding shipped from version 2013, and per command line until version 2012 (maintained by Microsoft) and 2013 and 2015 (maintained by the community). This command line support can be installed via the following Nuget package:

https://www.nuget.org/packages/MVCScaffolding/ (for Visual Studio 2012) https://www.nuget.org/packages/MVCScaffolding.VS2015/ (for Visual Studio 2013 and 2015) https://www.nuget.org/packages/MvcScaffolding.VS2015/1.0.10 (only for Visual Studio 2015, if the latest version gives any error)

By command line, I teach how to use the commands in these responses:

Using the embedded feature of Visual Studio

I’m guessing you’re using Entity Framework and MVC5 in your project.

First you need to create a Model. I’ll put an example:

using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace MeuProjeto.Models
{
    public class Color
    {
        [Key]
        public int ColorId { get; set; }

        [Required]
        public String Name { get; set; }
        [Required]
        public String Code { get; set; }

        public virtual ICollection<Product> Products { get; set; }
    }
}

Then right click on the directory Controllers of your solution > Add > Controller...

Add Controller

Choose the option MVC 5 Controller with Views, using Entity Framework:

Add Scaffold

Fill the Model and the context class. If a context class does not yet exist, create one via the button +. Click on Add:

Scaffolding 3

Once that’s done, one will be created Controller with the basic operations (List, Detail, Insert, Edit and Delete), more or less as shown in the image below:

Views

  • Gypsy, I would like to make a generator of Formularios http://www.wufoo.com/ understand? I don’t think I expressed myself well in my initial question..

  • Ah, good. In this case not only does my answer not serve, but your question also deserves to be closed because it is too wide.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.