HtmlGenericControl control = new HtmlGenericControl("input"); control.Attributes.Add("type", "button"); control.Attributes.Add("onclick",Page.ClientScript.GetPostBackEventReference(this, "btnMyQuery") //csharp/6021