public static void FocusControlOnPageLoad(string ClientID, System.Web.UI.Page page) { page.RegisterClientScriptBlock("CtrlFocus", @"<script> function GetDivPosition() { document.getElementById('GVWF').scrollTop = window.name; //--alert(numericPostion) FOR TESTING ONLY!!! } function ScrollIntoView() { var gridView = document.getElementById('ctl00_ContentPlaceHolder1_gvRptItems_BranchChief_With_Focus'); gridView.scrollIntoView((window.name * (window.innerHeight))); } function RunScripts() { ScrollIntoView(); GetDivPosition(); } window.onload = RunScripts; </script>"); }
ct100_ContentPlaceHolder1_gvRptItems_BranchChief_With_Focus
gridView
window.name
window.innerHeight
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)