how can i make an ID auto increment and hidden from user?

user3755752

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; }
}
Matteo Sganzetta

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.

edited at
0

Comments

0 comments
Login to comment

Related

How can I get the corresponding user_id (auto increment) value of a particular row in my database?

How can I make my query set order by descending in django based on auto increment id field

SQL Server-How can I make a varchar auto increment

How can I restart auto increment ID from 1 in an Android SQLite Database

How can I remove the ID column from a local sql table or change it to AUTO INCREMENT?

how can i submit the employee table id (auto increment) to the user table under the employee_id on form submit

How can I make the id field be hidden and assign itself?

How can I increment ID after featching it from the array

How can I update an existing record to have a new auto_increment id in MySQL?

How can I add auto-increment Id in these tables because the "identify" don't work?

How can I make increment for boostrap area-controls tag increment from thymeleaf

Can I override auto increment ID with Alice Fixtures?

How can I make the loop increment?

How do I make an auto increment integer field in Django?

How do I make a primary key without auto-increment?

How can I set my auto-increment value to start from 1 in MySQL?

How can I make a UISearchController start hidden?

How can I make a file hidden on Windows?

How can I make the command !say work with a user's id?

How can I make everything else hidden when I am at a certain part of a website (id link)?

How to make auto-increment field in app maker from 5000

How can I increment the id in jquery with for loop?

How to increment id without auto increment?

How to control auto increment id?

How to auto increment the the id in postgersql?

How to Auto increment an ID in java

How to get last auto increment id from a table in phpMyAdmin

How can I set AUTO_INCREMENT for @PrimaryColumn()?

How can I set no auto increment in migration laravel 5.3?