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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hiten PandyaPosted Feb 14, 2018, 7:29 AM
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.