|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Setting focus to TextBoxHi,,
Is there a way to set focus to an System.Web.UI.WebControls.TextBox control on a web form? The class doesn't seem to provide such facility? Basically I want to set input cursor to a TextBox when the page is first loaded or after the user submit invalid data. Thanks, - Simon You can set focus to a particular control with the Javascript "focus"
method. In ASP.NET 2.0 its even easier. Here are all the details: http://SteveOrr.net/faq/2in1.aspx Show quoteHide quote "Simon Cheng" <simon_cheng***@hotmail.com> wrote in message news:e0oPxgk8FHA.956@TK2MSFTNGP10.phx.gbl... > Hi,, > > Is there a way to set focus to an System.Web.UI.WebControls.TextBox > control on a web form? The class doesn't seem to provide such facility? > Basically I want to set input cursor to a TextBox when the page is first > loaded or after the user submit invalid data. > > Thanks, > - Simon > Thanks! ASP.NET 2.0's DefaultButton only supports (well) Button control. Is
there an equivalent for TextBox control? -Simon Show quoteHide quote "Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message news:e%23rS8Ov8FHA.1000@tk2msftngp13.phx.gbl... > You can set focus to a particular control with the Javascript "focus" > method. > > In ASP.NET 2.0 its even easier. > > Here are all the details: > http://SteveOrr.net/faq/2in1.aspx > > -- > I hope this helps, > Steve C. Orr, MCSD, MVP > http://SteveOrr.net > > > "Simon Cheng" <simon_cheng***@hotmail.com> wrote in message > news:e0oPxgk8FHA.956@TK2MSFTNGP10.phx.gbl... >> Hi,, >> >> Is there a way to set focus to an System.Web.UI.WebControls.TextBox >> control on a web form? The class doesn't seem to provide such facility? >> Basically I want to set input cursor to a TextBox when the page is first >> loaded or after the user submit invalid data. >> >> Thanks, >> - Simon >> > >
custom control client values gone with postback
Cool Web Parts? Server Control - object not saved when button clicked Newbie - question concerning page behaviour Problems with Custom Web Controls in VS 2005 Mouseover, mouseout, click etc on datagrid. DataList Issue Time textbox control Mailto Link in Gridview TableAdapter Scalar or "Single Value" Queries |
|||||||||||||||||||||||