private void Page_Load(object sender, System.EventArgs e)
{
//定制菜单
Button BtnAll=new Button ();
BtnAll.CommandArgument ="所有栏目";
BtnAll.Text ="所有栏目";
BtnAll.Command +=new CommandEventHandler(this.OnButton);
PHMenu.Controls.Add(BtnAll);
for (int i=0;i<dtItemName.Rows.Count;i++)
{
Button Btn=new Button ();
Btn.CommandArgument =dtItemName.Rows[i]["ItemName"].ToString();
Btn.Text =dtItemName.Rows[i]["ItemName"].ToString();
Btn.Command +=new CommandEventHandler(this.OnButton);
PHMenu.Controls.Add(Btn);
}
}
public void OnButton(Object Sender, CommandEventArgs e)
{
this.InitItems(e.CommandArgument.ToString());
}