Create a composite control , in that use javascript something like this if (MaxLength > 0 && TextMode == TextBoxMode.MultiLine) { // Add javascript handlers for paste and keypress Attributes.Add("onkeypress", "doKeypress(this);"); Attributes.Add("onbeforepaste", "doBeforePaste(this);"); Attributes.Add("onpaste", "doPaste(this);"); // Add attribute for access of maxlength property on client-side Attributes.Add("maxLength", this.MaxLength.ToString()); // Register client side include - only once per page if (!Page.ClientScript.IsClientScriptIncludeRegistered("TextArea")) { Page.ClientScript.RegisterClientScriptInclude("TextArea", ResolveClientUrl("~/FSjavaScript/textArea.js")); } } then u can use the control as many times u feel like , the scripts will not roll up