i'm working on C# MVC 4 web app
i created a page linked to a DB and my question is that in the Create New record the user can enter the ID, Name, ...
how can i hide in the View from the user the ID and make it take an auto incremental number for example when the user goes to page Create New he will have to start filling the Name, Address ... without seeing the ID field which must take automatically the value of a number:
here is my model code:
public partial class Employee
{
public int Identifier { get; private set; }
public string Name { get; set; }
public string Address { get; set; }
public string Status { get; set; }
}
Edit the view and remove the ID part from it, then it depends by how you designed the DB, if you have auto-increment in it, otherwise you should manage it in the controller. Matteo
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments