I running jQuery on my local website which works just fine. However, when I try to run that same exact website on a remote web server, the jquery just doesn't work. I am not getting any javascript errors.
Here is what I'm simply trying to do: When I run my website locally or even when I run it locally pointing to my staging server, it works just fine as I explained. However, if I try and run it from the actual staging server, when clicking the "Generate PDF" button, it doesn't kick off the process. It's as if the value is coming back false and not executing the part I need to be executed or the js is simply not being executed. I triple verfified that the js is NOT commented out. It disables the button, but no activity. Is there anything I need to do implement or set up on the staging server?
Here is my _Layout.cshtml file:
<head>
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2012.2.913/kendo.common.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2012.2.913/kendo.dataviz.min.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/kendo/2012.2.913/kendo.blueopal.min.css")" rel="stylesheet" type="text/css" />
<script src="~/Scripts/jquery-1.7.1.min.js" ></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
<script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
<script src="~/Scripts/modernizr-2.5.3.js"></script>
<script src="@Url.Content("~/Scripts/kendo/2012.2.913/kendo.all.min.js")"></script>
<script src="@Url.Content("~/Scripts/kendo/2012.2.913/kendo.aspnetmvc.min.js")"></script>
</head>
Index View:
<script type="text/javascript">
$('#btnRefresh').click(function () {
Refresh();
});
function Refresh() {
var LoanID = $("#LoanID").val();
if (parseInt(LoanID) != 0) {
$('#ShouldGeneratePdf').val(false)
document.forms[0].submit();
}
else {
alert("Please enter a LoanId");
}
}
$('#btnGeneratePDF').click(function () {
DisableGeneratePDF();
$('#ShouldGeneratePdf').val(true)
});
function DisableGeneratePDF() {
$('#btnGeneratePDF').attr("disabled", true);
$('#btnRefresh').attr("disabled", true);
}
</script>
Controller: When coming back from the js, the model.ShouldGeneratePdf value appears to be false when it should be true.
if ((submitbutton == "Refresh") || (submitbutton == null) && (model.ShouldGeneratePdf == false))