內容閑暇時間,把內容過程中比較常用的內容備份一下,如下的內容內容是關於C# 動態生成的按鈕及定義按鈕的事件的內容,應該對碼農們也有用途。
HtmlGenericControl control = new HtmlGenericControl("input");
control.Attributes.Add("type", "button");
control.Attributes.Add("onclick",Page.ClientScript.GetPostBackEventReference(this, "btnMyQuery")
寫入到界面中2、后台回發攔截與處理
if (Page.IsPostBack)
{
string eventArgument = Page.Request.Form["__EVENTARGUMENT"];
if (!String.IsNullOrEmpty(eventArgument)
&& eventArgument.Equals("btnMyQuery"))
{
}
}