[ToolboxData("<{0}:ServerControl1 runat=server></{0}:ServerControl1>")]
public class ServerControl1 : WebControl
{
Button btnDebugScript = new Button();
protected override void CreateChildControls()
{
this.Controls.Add(btnDebugScript);
base.CreateChildControls();
}
protected override void Render(HtmlTextWriter writer)
{
btnDebugScript.Text = "调试客户端脚本";
btnDebugScript.OnClientClick = "ClientClickEvent()";
btnDebugScript.RenderControl(writer);
}
}
创建合并的button按钮,并且给予其客户端脚本方法ClientClickEvent