Get input values in html for object in ASP.NET MVC [closed]

-3

I wanted to know how do I get the information from the data entered in the html input to create an object by my MVC template and save it to the database. Note: I already have all the model classes, the interface classes, I just need to mount the objects with the data to do the data post.

! [Image of how the html is] link

A piece of HTML:

<div class="form-group">
     <label for="Email" class="control-label">Email</label>
     <input type="email" class="form-control" id="Email" placeholder="Email" data-error="Bruh, that email address is invalid" required>
     <div class="help-block with-errors"></div>
</div>
    
asked by anonymous 19.08.2017 / 22:32

1 answer

-2

Good evening ... I understand that you are working with MVC ... So it would be more or less like this the Controller is asked to execute the following code:

[HttpPost]
    [ValidateAntiForgeryToken]
    public ActionResult Create([Bind(Include = Email)] Project project, HttpPostedFileBase filetransfer)
    {
            context.Project.Add(project);
            context.SaveChanges();

I hope I have helped!

    
19.08.2017 / 23:33