Hi,
In the C#.Net 2.0 WebForm standard TextBox Control, is it possible to has
the input look like * whenever we keyin?
Also, does it have an event like OnEnter for 'Enter'?
Thanks for help.
Jason
Muhammad Naveed Yaseen - 04 Sep 2007 05:11 GMT
> In the C#.Net 2.0 WebForm standard TextBox Control, is it possible to has
> the input look like * whenever we keyin?
TextMode="Password"
> Also, does it have an event like OnEnter for 'Enter'?
One may detect enter key like following (however it is usually not a
proper way, if one has to detect enter key like this, then there has
probably been some mistake in document/object model).
<asp:TextBox runat="server" id="txtSampleTextBox"
onkeypress="KeyPressHandler(event)" />
//in javascript
function KeyPressHandler(e)
{
var keynum;
if(window.event) // IE
{
keynum = e.keyCode;
}
else if(e.which) // Netscape/Firefox/Opera
{
keynum = e.which;
}
if(keynum == 13)
{
// Ok this is 'Enter' key, do here whatever required for
'Enter' (perhaps call OnEnter() !! )
}
}
Mixolydian - 21 Sep 2007 06:14 GMT
> Hi,
>
> In the C#.Net 2.0 WebForm standard TextBox Control, is it possible to has
> the input look like * whenever we keyin?
You can hide the password by setting the TextMode property of the
password text box to Password.