Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is wrong when I get "Internal Server Error" returned from a jquery $.ajax call on an ASP.NET MVC project?
    primarykey
    data
    text
    <p>Here is my ajax call:</p> <pre><code>response = $.ajax({ type: "POST", url: "/Row/getRowName", dataType: "json", data:({ currRow : rowName, offset : 5 }), error:function(request){alert(request.statusText)}, success:function(result){alert(result)} }).responseText; </code></pre> <p>I get Internal Server Error as an alert. I also have a breakpoint set in my method getRowName in my RowController.</p> <p>Here's the getRowName method:</p> <pre><code> [AcceptVerbs(HttpVerbs.Post)] public string getRowName(string currRow, int offset) { string rowName; rowName = _rowRepository.getRowNameByOffset(currRow, offset); return rowName; } </code></pre> <p>What causes an Internal Server Error? How can I fix it? Am I using the whole controller concept properly or should I be using WebServices for things like this?</p> <p><strong>Edit:</strong> The controller that calls the page is HomeController where as the call I'm making is to RowController. RowController is in the same folder as HomeController (not sure if that matters).</p> <p>But I found out if I create a mock function:</p> <pre><code> [AcceptVerbs(HttpVerbs.Post)] public string sayHi() { return "Hi"; } </code></pre> <p>and calling it the same way (different url since it's in the home controller):</p> <pre><code>response = $.ajax({ type: "POST", url: "/Home/sayHi", dataType: "json", error:function(request){alert(request.statusText)}, success:function(result){alert(result)} }).responseText; </code></pre> <p>Any ideas as to why this would work and the other wouldn't?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload