Thursday, December 30, 2004

Adding attributes to the HtmlTextArea control

You can add as many attributes you want in any control the limitation is that it must know those attributes.

_textarea = new HtmlTextArea();
_textarea.ID = "HAHA";
_textarea.Attributes.Add("onkeypress","return taLimit()");
_textarea.Attributes.Add("onkeyup","return taCount(myCounter)");
_textarea.Attributes.Add("name","Description");
_textarea.Attributes.Add("rows","7");
_textarea.Attributes.Add("wrap","physical");
_textarea.Attributes.Add("runat","server");
_textarea.Cols = 40;
_textarea.Attributes.Add("maxLength","255");


In the above code you can see that I added many attributes to the HtmlTextArea control.

No comments: