Storing what a user selects from a dropdown to a session variable but it gives a null error which should not be. looked for the error i know it lies here. tried for 2 days but no success. Just wondering is there another way to achieve my goal?
cs [HttpPost]
public IActionResult Index(Student_List studentss)
{
int Studnentid = studentss.Stid;//problem is it is not showing the id or storing the id
HttpContext.Session.SetInt32("Stid", Studnentid);//if i change studentid to 1 it works