I have a table named country and it have a 3 Columns :
ID: generated primary key
Country_Code : not primary key but it is Unique and in most of the time I will
use it Instead of ID.
Country_Name : the long name of the country
I can not change any thing from above , it is business requirement.
I used asp.net mvc to generated CURD functionality then I changed the code so that it depend on Country_Code instead of ID so fro example My detail page url look like this:
something.com/country/detail/ss
I success in read , write and delete but in edit I failed to pass the validation statement (ModelState.IsValid) the problem is that when data come from my edit page ID always is 0.
You can create a HiddenFor to save the ID when post it to controller.