title: An error occurred while processing your request. MVC 4
body: <p>I'm creating a MVC 4 application, I had error like following.</p>
  
  <p><img src="https://i.stack.imgur.com/IvgUb.png" alt="enter image description here"></p>
  
  <p>I tried lot of things but I can't find what is the problem.here is my Controller source</p>
  
  <pre><code>    public ActionResult Index(string EventId)
      {
  
          HttpCookie cookie = this.ControllerContext.HttpContext.Request.Cookies["User"];
  
          if (cookie != null)
          {
              string Type = (cookie["Type"] == null || cookie["Type"] == "") ? null : cookie["Type"].ToString();
              string Username = (cookie["Username"] == null || cookie["Username"] == "") ? null : cookie["Username"].ToString();
              ViewBag.Message = Type;
              ViewBag.Username = Username;
  
  
              try
              {
                  string ReplaceEventID = EventId.Replace('-', '/');
  
                  ViewBag.Message = ReplaceEventID;
                  IEnumerable&lt;Job&gt; JobListRelatedToEvent = DBContext.Jobs.Where(x =&gt; x.EventId == ReplaceEventID);
                  return View(JobListRelatedToEvent);
              }
              catch
              {
                  return View();
              }
          }
          else
          {
              return RedirectToAction("Index", "Home");
          }
      }
  </code></pre>
  
  <p><strong>UPDATE:</strong>
  When it run on my local machine it works fine, but after i published to the server I got this error.</p>
  
  <p>Can anyone tell about what's the wrong?</p>