onblur and onfocus attributes for textbox created progrmatically in vb.net

Posted by ferrer on Stack Overflow See other posts from Stack Overflow or by ferrer
Published on 2010-04-09T23:21:12Z Indexed on 2010/04/09 23:23 UTC
Read the original article Hit count: 408

Filed under:
|
|
|

how do i put the onblur and onfocus attributes on a textbox created programatically? here's my code -

td = New HtmlTableCell td.Style.Add("padding-bottom", "5px") Dim txtbox As New TextBox txtbox.Style.Add("width", "96%") txtbox.ID = "ename" td.Controls.Add(txtbox) tr.Cells.Add(td) td.Style.Add("padding-top", "5px")

now i want to add onblur and onfocus. is there something like? --

            txtbox.attributes.Add("onblur","Enter Name")
            txtbox.attributes.Add("onfocus","")

i tried this, and doesn work. does anyone know how to do this?

© Stack Overflow or respective owner

Related posts about textbox

Related posts about onblur