I am having a (I think stupid) problem.
I have a controller, Index method, and its view has some JQuery functions.
It works fine, and the JQuery methods work perfectly.
the link I use is
http://localhost:54209/TestInput/
but if I put
http://localhost:54209/TestInput/Index
the JQuery functions do not work. From what I know they should act exactly the same.
That is the only thing that I change
I really appreciate your help. This has been driving me crazy during the last couple of hours!
For example, This is my script
<script>
$(document).ready(function() {
$('select#testCategoriesUniqueId').change(function() {
var testCategory = $(this).val();
$.ajaxSetup({ cache: false });
alert ("AAA");
$.ajax({
url: "TestInput/listTestCases/" + testCategory,
dataType: "json",
type: 'post',
success: function(data) {
$("#testCasesUniqueId").removeOption(/./);
for (var i = 0; i < data.length; i++) {
var val = data[i].Value;
var text = data[i].Text;
$("#testCasesUniqueId").addOption(val, text, false);
}
}
});
});
});
In both cases, I get an alert, but In the second link, I can not call the controller.
It doesn't call the listTestCases method of my controller.
Update:
So I tried to use parameters instead of the exact link, I still have the problem, I got both sources, and got a diff, the only difference is
<form name="aspnetForm" method="post" action="Index" id="aspnetForm">
vs.
<form name="aspnetForm" method="post" action="TestInput" id="aspnetForm">
and
<form action="/TestInput/Index" method="post">
vs.
<form action="/TestInput" method="post">
Which I beleive has nothing to do with the jQuery.
I still see the laert in both cases. but the JQuery works in ~/TestInput and not with the ~/TestInput/Index.