How to get MaxId for different sub-models in Asp.Net.
Eg.
Model-2 1 Model-2.1
Model-2 2 Model-2.2
Model-2 3 Model-2.3
Model-3 1 Model-3.1
Model-3 2 Model-3.2
Model-3 3 Model-3.3
At here id is maxid it should increment based on models.
At here I have models in dropdownlist while selecting the "model-1" it should check in database whether that model is there or not.
---If it's not there the particular model-1 id should be incremented as +1
---If it's there then the particular model-1 last id it should get and increment with +1
it's same for Model-2, Model-3..
If there's any solution please let me know it..