'Getting form filed value using umbraco

I've tried to get the form input value using model but it throws the following error

enter image description here

The model I've used is

public class RegisterContentModel : ContentModel
    {
        public RegisterContentModel(IPublishedContent content) : base(content)
        {
        }
        public int id  { get; set; }
        public string Name { get; set; }
        public string Location { get; set; }
    }

The View page I,ve used is

@{

    Umbraco8_1Entities1 _context = new Umbraco8_1Entities1();
    RegisterContentModel model = new RegisterContentModel(IPublishedContent content);
    var value = _context.Employees.Where(i => i.ID == model.id)
     .Select(i => new { Name = i.Name });
    foreach (var item in value)
    {
        <p>Name : @item.Name</p>
    }
}

I'm getting error in the line

RegisterContentModel model = new RegisterContentModel(IPublishedContent content);

What is the solution to get rid of this problem??????????

-Jothipriya



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source