I have an Asp.Net application that has a menu on a main screen that has 2 links, each one for a page.
When I click on the first link and load the first page, the $(document).ready()
function runs right and loads all the components I need.
When I click on the second link, reviewing Firebug step by step, I notice that the $(document).ready()
function is not executed. What is the reason for this?
This application uses a layout page that is rendered before.
Function $(document).ready()
$(document).ready(function () {
$('#spn').spinit({ min: 1, max: 100, stepInc: 1, pageInc: 10, height: 13, initValue: 95/*,callback: filtraModeloGrafico4*/});
//Carrega o datepicker
jQuery('#_InitialDateValue').datetimepicker( { format: 'd/m/Y H:i' } );
jQuery('#_FinalDateValue').datetimepicker({ format: 'd/m/Y H:i' });
jQuery('#_InitialDateValue2').datetimepicker({ format: 'd/m/Y H:i' });
//Carrega a combo com os dias da semana
$('#idComboTurno').multiselect({
includeSelectAllOption: true,
nonSelectedText: 'Select a week day',
nSelectedText: 'days',
numberDisplayed: 0
});
});
The name of the file that has the function $(document).ready()
is site.js
This page loads everything right:
@{
ViewBag.Title = "Sequence Inspection - Graphics Report";
}
@Scripts.Render("~/Scripts/site.js")
<div class="row-fluid">
<form class="form-inline">
<div class="control-group span12">
// Código...
</div>
</form>
</div>
Page that does not load the function $(document).ready()
@{
ViewBag.Title = "Sequence Inspection - Failure Report";
}
@Scripts.Render("~/Scripts/site.js")
<div class="row-fluid">
@using (Html.BeginForm("ExportaExcel", "FailureReport", FormMethod.Post, new { @class = "form-inline" }))
{
//Código HTML
}
</div>