I have the following:
function setupGrid(labId) {
var url = '@Url.Action("GetProgData", "Prog")' + '?lId=' + lId;
alert(url);
$("#loginList").jqGrid({
url: url,
datatype: "json",
colNames: ['PNum', 'Client', 'Salesperson', 'Email', ....
.....
.....
I also have the following code:
<script type="text/javascript">
$(document).ready(function () {
var labId;
$("#LabId").change(function () { // point1
labId = $("#LabId").val();
setupGrid(labId); // this goes to setupGrid but DOES NOT go to the given url( url = '@Url.Action("GetProgData", "Prog")' + '?lId=' + lId;)
});
// point 2
setupGrid(labId); // this goes to setupGrid and DOES go to the given url(url = '@Url.Action("GetProgData", "Prog")' + '?lId=' + lId;)
......
When the program runs the first time, it goes to point2 which then goes to setupGrid function and goes to the url value in:
url: url
When I call it from the .change (point1) it again goes to SetupGrid and the alert shows the correct value but cannot understand why when I put a breakpoint at the url it does not go to the url. Why does it work the first time but when I do it from the .change it does not to go to the url.