Several solutions exist to handle multiple buttons on a form, however, none of the existing solutions were sufficiently complete to handle the cases I wanted to handle in a clean way. In this post, I present the features of the button handler I created.
|
<!DOCTYPE html>
<html>
<head>
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/sessvars.js")" type="text/javascript"></script>
<script type="text/javascript">
// Restore vertical scroll positions on reposts:
$(window).unload(function () {
sessvars.scrollTopUrl = document.location.href;
sessvars.scrollTop = $(window).scrollTop();
});
$(document).ready(function () {
if (document.location.href == sessvars.scrollTopUrl) {
$(window).scrollTop(sessvars.scrollTop);
}
});
</script>
</head>
<body>
<div class="page">
<div id="header">
<div id="title">
<h1>My MVC Application</h1>
</div>
<div id="logindisplay" style="height:1px;"></div>
<div id="menucontainer">
<ul id="menu">
<li>@Html.ActionLink("Employee Bonus System", "Index", "EmployeeBonus")</li>
</ul>
</div>
</div>
<div id="main">
@RenderBody()
</div>
<div id="footer">
</div>
</div>
</body>
</html>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.