find control in page

后端 未结 9 1066
孤城傲影
孤城傲影 2020-12-11 02:37

HTML


    
9条回答
  •  隐瞒了意图╮
    2020-12-11 03:23

    To find the button on your content page you have to search for the ContentPlaceHolder1 control first. Then use the FindControl function on the ContentPlaceHolder1 control to search for your button:

     ContentPlaceHolder cph = (ContentPlaceHolder)this.Master.FindControl("ContentPlaceHolder1");
     Response.Write(((Button)cph.FindControl("a")).Text);
    

提交回复
热议问题