2
protected void btnbatch_Click(object sender, EventArgs e)
{       
    Button btnactual= sender as Button;
    ContentPlaceHolder myContent =
(ContentPlaceHolder)this.Master.FindControl("ContentPlaceHolder1");
}

如何使用 .I 在内容占位符中查找控件for-each。我将代码放入其中,Div tag 但没有得到。

谁能帮我吗?

4

1 回答 1

6
Protected void btnbatch_Click(object sender, EventArgs e)
{

    Button btnactual= sender as Button;
    ContentPlaceHolder myContent = 
   (ContentPlaceHolder)this.Master.FindControl("ContentPlaceHolder1");

    foreach (Control ctrl in myContent.FindControl("divBatches").Controls)
    {
        if (ctrl.ID == btnactual.ID)
        {
           //blah blah
        }
     }
  }

尝试这个.....

于 2013-09-25T06:34:45.120 回答