Hi, Thanks.
Following is our code:-
We have a layout.cshtml which contains html for header and footer as follows:-
<!DOCTYPE html>
<html lang="en">
<head>
... some code ...
@Styles.Render("~/Content/mobileCss", "~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery", "~/bundles/jquerymobile")
</head>
<body>
<div data-role="page" data-theme="f">
.... some code .....
<div data-role="content">
@RenderBody()
</div>
.... some code .....
@RenderSection("scripts", required: false)
</div>
</body>
</html>
And then, we have a Login.cshtml, which has the following:-
@using (Html.BeginForm(FormMethod.Post))
{
.. some code ...
<fieldset>
<div><input type="checkbox" id="checkkBoxId" /></div>
<label for="checkkBoxId">Mask</label>
</fieldset>
... some code ....
}
<script type="text/javascript">
$(document).bind('pageinit', function () {
alert("Ready");
$("#checkkBoxId").click(function () {
alert("Clicked");
});
});
</script>
It is the "Clicked" alert that is not displayed, when we either re-load the Login page or a model-state error occurs.