HI,
I want to know how to set id value in controller after first save and that id can be used in another function in controller to send a mail?
What checking have to be given?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Hiten PandyaRank #1,237 · 1.4K reputationPosted Feb 14, 2018, 2:29 AM EST
you can set the value of ID column by creating object of the model like this
Student st=new Student()
st.ID = //here you can set the ID column that you get from view.
and if you want to pass your ID value from one controller method to another then you should go with TempData refer the below link.
http://www.c-sharpcorner.com/article/using-tempdata-viewdata-and-viewbag-in-Asp-Net-mvc-5-0-par/
Hope it helps you.
Thanks.