|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Textbox Select TextOn an aspx page I have an asp:TextBox.
I am able to give the textbox the focus when the page is loaded. I would like to be able to select (highlight) the contents of the textbox when it gets the focus, so that the user can type an entry to replace the selected text, or tab-out of the textbox to keep the selected text. I this behavior supported for an asp:TextBox ? If so, how do I implement it ? Sample code would be appreciated. How do I research this topic in Microsoft documentation ? Thanks, Jim With custom attributes (expando attributes, typical to web controls) which
are passed as-is to the client-browser (and can be used to append js to the HTML element) Example: <asp:TextBox ID="TextBox1" runat="server"onfocus="this.select()" /> which passes the onfocus="this.select()" to browser to the INPUT element (which is rendered), and again causes client js functionality to select the text in textbox when it receives the focus. Show quoteHide quote "Jim McGivney" <mcgiv1@no-spam.sbcglobal.net> wrote in message news:OGYFPP$AGHA.1676@TK2MSFTNGP09.phx.gbl... > On an aspx page I have an asp:TextBox. > I am able to give the textbox the focus when the page is loaded. > I would like to be able to select (highlight) the contents of the textbox > when it gets the focus, so that the user can type an entry to replace the > selected text, or tab-out of the textbox to keep the selected text. > I this behavior supported for an asp:TextBox ? > If so, how do I implement it ? Sample code would be appreciated. > How do I research this topic in Microsoft documentation ? > Thanks, > Jim >
Datagrid only shows the header
Wizard Control - Referencing buttons in <StepNavigationTemplate> Master Page problem Walking thr DataReader Custom memebrship provider problem Sorting in GridView problem User Control First Load Can RDLC Reports be used with Oracle data sources? Membership roles question Cant get a gridview to bind to my dataset |
|||||||||||||||||||||||