So, setting the focus was actually pretty easy! I put this in my Page_Load method:
string controlName = Request.Params.Get("__EVENTTARGET");
if (controlName == "create_lbtn") {
txt_listtitle.Focus(); }
else if (controlName.Substring(0,9) == "edit_link") { //we have many of these controls, any will do.
txt_search_rdb.Focus(); }
else { welcome_lbtn.Focus(); }
So, now the Delete button does not fire on refresh -- nor any other button. And, as it turned out, JavaScript was not even necessary!
I'm working on a project to syndicate library content with RSS.... and learn .NET, C#, and AJAX
Monday, July 16, 2007
Focus()
Posted by Jody Condit Fagan (JCF) at 10:53 AM
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment