Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

ASPNet 2.0 TextBox mask question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jason Huang - 04 Sep 2007 01:47 GMT
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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.