Good morning, everyone. I am passing a session variable from my aspx.cs to ashx.cs. However, I always get a null reference exception. Below is my code.


this line: string InsuranceType = context.Session["InsuranceType"].ToString(); gets the null reference exception.
Thank you so much for any help.

Jes SiePosted Mar 27, 2024, 4:54 AM
I got it!. I need to reference the SessionState.
using System.Web.SessionState;