G Guest Oct 5, 2004 #1 Does anyone know how to set the focus to a control programatically in my code for an asp.net app?
X Xavier Pacheco Oct 5, 2004 #2 You basically have to use client side java script code. See the article: http://archive.devx.com/dotnet/articles/rj121801/rj121801-1.asp -- Xavier Pacheco Xapware Technologies Inc manage your projects: www.xapware.com/ActiveFocus.htm the blog: www.xavierpacheco.com/xlog the book: www.amazon.com/exec/obidos/ASIN/0672324431//xavierpacheco-20
You basically have to use client side java script code. See the article: http://archive.devx.com/dotnet/articles/rj121801/rj121801-1.asp -- Xavier Pacheco Xapware Technologies Inc manage your projects: www.xapware.com/ActiveFocus.htm the blog: www.xavierpacheco.com/xlog the book: www.amazon.com/exec/obidos/ASIN/0672324431//xavierpacheco-20
C Cor Ligthert Oct 6, 2004 #3 Todd I do it this way (I cannot do it from "code behind" because that it has to be runned as last) <INPUT tabindex="1" id="fieldid" type="text" size="27"> fieldid is just the name of the control //This should be the last rows in your html aspx file <script language="JavaScript"> document.all("fieldid").focus(); </script> </HTML> I hope this helps a little bit? Cor
Todd I do it this way (I cannot do it from "code behind" because that it has to be runned as last) <INPUT tabindex="1" id="fieldid" type="text" size="27"> fieldid is just the name of the control //This should be the last rows in your html aspx file <script language="JavaScript"> document.all("fieldid").focus(); </script> </HTML> I hope this helps a little bit? Cor