protected override void OnPreRender(EventArgs e)
{
CreateJavascriptFunction();
// Adding the TextAlign property to the control's stylesheet.
if (TextAlign != null && TextAlign != String.Empty)
Style.Add(HtmlTextWriterStyle.TextAlign, TextAlign);
Attributes.Add("onkeypress", OnKeyPressFunctionName + "(event)");
base.OnPreRender(e);
}