Click here to Skip to main content
15,922,512 members

Comments by Mitchell Schaff (Top 4 by date)

Mitchell Schaff 19-Dec-19 19:02pm View    
When executing the page in Chrome, the following error is reported:
jquery-3.3.1.js:9600 GET http://localhost:54979/bandwidthchange/FetchBandwidth?UNIID=1539 500 (Internal Server Error)

Forgive me if this is a newbie question, but does this JsonResult method need to be a Post method rather than the Get method?
Mitchell Schaff 19-Dec-19 18:57pm View    
I realized after I posted this that I was asking the wrong question. I don't have the correct handler in place to process the button press that was generating this error.

However, when I made the suggested change, adding the $ sign in front of the reference, the page still does not call the bwURL method. If I try to debug the script in IE 11, it parses the .getJSON call line of code, but never seems to get to the "if (!data)" code. Something is not quite right with that call, but IE doesn't give me any information on what the issue is. I'd appreciate any pointers on this. Thanks!
Mitchell Schaff 19-Dec-19 14:59pm View    
Thanks for the heads-up on this. That was an oversight on my part.
Mitchell Schaff 19-Dec-19 14:57pm View    
Thanks for clarifying that, your answer definitely made a difference!

One related question: after making that change, I'm getting a response that
Quote:
The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/bandwidthchange/Index.aspx
~/Views/bandwidthchange/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Views/bandwidthchange/Index.cshtml
~/Views/bandwidthchange/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml
But that puzzles me, because it finds the FetchBandwidth method in the controller correctly if I define the method with just one parameter and pass a single parameter from the .getJSON call. Now, however, with the method defined as
Hide Copy Code
public JsonResult FetchBandwidth(int UNIID, int NetworkID)
and the .getJSON call revised to pass the second parameter correctly, the routine raises the error show above. For reference, the view is named Edit.cshtml, and the controller is named BandwidthChangecontroller.cs

Any hints on what might be causing the error?