<script type="text/javascript" language="javascript">
var postbackElement;
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest);
Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoaded)
function beginRequest(sender, args) {
postbackElement = args.get_postBackElement();
}
function pageLoaded(sender, args) {
if (typeof (postbackElement) === "undefined") {
return;
}
if ((postbackElement.id) === "btnStepNext" || (postbackElement.id) === "btnStepPrevious") {
window.scrollTo(0, 0);
}
}
</script>
Then I set the Next and Previous button in the Wizard control to ClientIDMode="Static" so the Javascript could identify them and it worked great!
No comments:
Post a Comment