Geeks With Blogs


Aaron Li's Blog Write it down before I forget December 2007 Entries
Set Focus On Page Load
Scenario: I have a masterpage, and there is a search text box on it. For most pages, when the page is loaded, I want to set focus on the search box; for other pages, to a control on that page. Rather than set focus on every page, I create a pulic function in a class. For those pages the focus is set to a specific control, this function is called. public void SetFocus(string vControl) { string strJS; strJS = "<script>" + "var o = document.getElementById('" + vControl + "'); " + "if((o != undefined) ......

Posted On Thursday, December 6, 2007 7:23 PM

Copyright © Aaron Li | Powered by: