Home » FAQ » ASP.NET » Session » How can I use Session variables in a class
Use HttpContext.Current.Session
VB.NET
HttpContext.Current.Session('Value1') = '1'
C#
HttpContext.Current.Session['Value1'] = '1';
In similar manner you can use Application Variables too.
Platform BlazorASP.NETWinFormsWPF.NET MAUI
Question *
Answer (Optional)
Email (Optional)
Email address is only for further clarification on your FAQ request. It will not be used for any other purpose.
Please leave this field empty.
Share with