Showing posts with label textboxes. Show all posts
Showing posts with label textboxes. Show all posts

Monday, March 26, 2012

Populate a Password Textbox from DB

Hello,

I have a query that populates several textboxes on my page.

I have a textbox called tboxPassword and it's type is set to password.

The the query runs, the Password box is left empty. I'm assuming this is some feature of the 'password' type assigned to the box. Is there anyway to overcome this? It's ok if the password still appears as ****, but I'd like it to be in the boxes.

Thanks!
Jason<input type="password" value="PASSWORDHERE" /
<asp:textbox TextMode="password" text="blahblahblah" runat="server" /
In either case, the password will appear as ****, but the underlying HTML (viewable through a simple "View Source") will show the password in plain text. In otherwords, you lose any and all password security by doing this and you shouldnot do it.
Actually, you cannot populate a password textbox from code. Even if you try to assign it a value, hoping it will appear as ****, it will not work.

As pickyh3d said, you shouldn't want to do this.

You can't do it anyway.
heh woops. I never tried it, so I just figured it would work... you could cheat and hard code it into an input tag, but you still shouldn't.

Learn something new everyday.

Wednesday, March 21, 2012

Populate Textboxes?

I am trying to populate a textbox with a random number and for the life of me I cant get the textbox to populate... any help?

Sub Page_Load()

Dim oRandom As New Random()
Dim iNum As Integer
iNum = oRandom.Next(1, 100000)

textbox1.text = iNum

end sub

I run the page and the textbox is still blank.Is the textbox standalone in the page, or is it nested in a formview?

Can you put anything in the textbox, i.e. textbox.text = "something"
no its not letting me put textbox1.text ="anything" ... I do have it between Form tags...

Im lost
Is it supposed to populate on page load? If so do you have te call inside an if not isportback...
yea I would like for it to populate on the page load
In that case, on the page load sub, add the following:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

If Not IsPostBack Then
'Put all your page load stuff in here including the textbox piece
Dim oRandom As New Random()
Dim iNum As Integer
iNum = oRandom.Next(1, 100000)

textbox1.text = iNum

End If

End Sub
bah Im an idiot... lol... thanks...

Anjari