Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey,

I've been stuck with this problem for almost a day now, so i figured I'll ask you guys. I'm developing a MVC3 application with jquery mobile. And it's been working just fine when I run it on my local dev server, but after I deployed it on my localhost, IIS7 I got got this error.

The site is running fine, until click a button that is doing a Jquery post to an actionresult in the controller.
JavaScript
$.post("/Games/PlayerAttendance", { gameId: parseInt(_gameId), status: parameter }, function (data) {
             $("#deltagare").html(data);
          });


The controller Action looks like this:
C#
public ActionResult PlayerAttendance(int gameId, string status)
        {
            Attendance attendance = new Attendance();
            if (status == "yes")
            { attendance.Status = (int)AttendanceStatus.Spelar; }
            else if (status == "maybe")
            { attendance.Status = (int)AttendanceStatus.Kanske; }
            else
                attendance.Status = (int)AttendanceStatus.Nej;
            attendance.fk_gameId = gameId;
            attendance.fk_playerId = 1;
            
            attendance.Name = "jane doe";  
            
            
            repository.SetParticipationStatus(attendance); 
            var attendees = repository.FindAttendeesInGame(gameId);
            return PartialView("Attendees", attendees);
        }


This works just fine in asp.net dev state, but it doesnt work when deployed. Any idea what i'm doing wrong? I've set the request limit to unlimited.
Posted
Comments
thatraja 10-Dec-11 0:17am    
What's the error message?
suunker 10-Dec-11 4:42am    
Oh sorry, forgot to share that. It's 404.0, Not found error. That is weird, because the action is there and the view is there.

1 solution

Try a fully qualified path where you have $.post("/Games/PlayerAttendance",.
That is pretty much the only thing that could be the issue with a 404.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900