How to select a div element in the code-behind page?

前端 未结 6 1335
时光说笑
时光说笑 2020-12-29 09:11

I have a div element:

I want to control this element from the code-behind page an

6条回答
  •  没有蜡笔的小新
    2020-12-29 09:20

    Give ID and attribute runat='server' as :

    //somecode Codebehind:

    Access at code behind

        Control Test = Page.FindControl("portlet_tab1");
        Test.Style.Add("display", "none"); 
    
        or 
    
        portlet_tab1.Style.Add("display", "none"); 
    

提交回复
热议问题