ASPNet 2.0 TextBox mask question

J

Jason Huang

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
 
M

Muhammad Naveed Yaseen

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() !! )
}
}
 
M

Mixolydian

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,172
Latest member
NFTPRrAgenncy
Top