can I add BehaviorID attribute for asp.net textbox and use it to be recognize by java script??
On other word, I want to to apply some java script function on asp.net text box and I want to let the java script find the asp.net text box by the BehaviorID.
The TextBox.Attributes.Add will add the attributes correctly but they will not be XHTML compliant. In order to add XHTML compliant attributes you can use ClientScript.RegisterExpandoAttribute method.
The above will add the BehaviorID as a JavaScript property instead of adding attribute directly into the TextBox element.