There are many way generate auto ID. U can Use according to ur need:
But here u have not clear ur requirement so i m giving answer in general.
1. Use Auto Increment field : http://www.w3schools.com/sql/sql_autoincrement.asp[
^]
2.use GUID : http://msdn.microsoft.com/en-us/library/system.guid.newguid.aspx[
^]
3.Use c# to generate next number :
If u r using simple number as ID than do following to get new ID on page load
i. get max value from ID column using max()
ii. increment it by 1
iii. use new value in textbox
4.use custom ID :
U can have ur format of ID like M001, PR003, MAB1 etc
So for this kind of id u can do following
i. get max value from ID column using max()
ii. separate number and char
iii. do increment in number
iv. join number and character
v. use new value in textbox
U can have more methods. search Google for that