protected override void CreateChildControls() { InternalHiddenField l = new InternalHiddenField(); l.ID = this.ControlID + "_textboxInternal"; this.Controls.Add(l); KeyPressEventExtender ext = new KeyPressEventExtender(); ext.ControlID = this.ControlID; ext.TargetControlID = this.ControlID + "_textboxInternal"; this.Controls.Add(ext); base.CreateChildControls(); }
public override void RenderControl(System.Web.UI.HtmlTextWriter writer) { base.RenderControl(writer); if (State == ControlState.Designtime || State == ControlState.Preview) { InternalHiddenField l = new InternalHiddenField(); l.ID = this.ControlID + "_textboxInternal"; l.RenderControl(writer); Label label = new Label(); label.Text = "Keypress event placeholder"; label.RenderControl(writer); } }