I am getting this error in my MVC3 Application. Please Help...
Error :
An object reference is required for the non-static field, method, or property 'System.Web.Mvc.Controller.HttpContext.get'
On Line:
string desigId = HttpContext.Current.Session["Desig_Id"].ToString();
the code with its method in class:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Helpers;
using System.Net.Mail;
using System.Net;
using System.ComponentModel;
using System.Diagnostics;
using System.Threading.Tasks;
namespace ApricaCRMEvent.Controllers
{
public class NotificationController : Controller
{
//to send email notification
[Authorize]
public static string SendEmailNotification(int crmId, string username, string action)
{
string desigId = HttpContext.Current.Session["Desig_Id"].ToString();
}
}
}