Reputation: 217
Server Error in '/' Application. The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Contact/PopBid
Controller
[HttpPost]
public ActionResult PopBid(int jobid)
{
var getjob = _context.jobService.GetById(jobid);
return View();
}
JavaScript
function Singin(jobid) {
$.fancybox({
'transitionIn': 'elastic',
'transitionOut': 'elastic',
'easingIn': 'easeOutBack',
'easingOut': 'easeInBack',
'width': 850,
'height': 394,
href: "/Contact/PopBid",
data: "jobid=" + jobid,
'type': 'iframe'
});
}s
<img alt="" onclick="javascript:Singin(@job.ID);" src="/Content/WalkFish/Images/bidimg1.png" style="width: 180px; height: 140px;">
onclick event
pop open well but get error in the pop that
Server Error in '/' Application. The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Contact/PopBid
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929
Upvotes: 1
Views: 1569
Reputation: 3459
Looks like you are GETing /Contact/PopBid not POSTing to it.
Because of the [HttpPost]
attribute above you method the GET action is not available.
Change the attribute to [HttpGet]
[HttpGet]
public ActionResult PopBid(int jobid)
{
var getjob = _context.jobService.GetById(jobid);
return View();
}
Upvotes: 2