Within View.cshtml, there is a section where I am checking for the existence of an object named Reservation in the session.
<head>
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryval")
<script type="text/javascript">
$(function () {
if ( @Session["Reservation"] )
{
$('.reservationDetails :input').attr("disabled", false));
$('#termSection :input').attr("disabled", true);
}
});
</script>
</head>
Upon loading the page for the first time, the button with the id termSection is active. However, even after saving the object Reservation in the session during another action, this button remains active when redirected back to View.cshtml. I suspect the issue lies in the condition used to check if the object from the session is null.