c# - error using FindControl on div id

前端 未结 4 1240
小蘑菇
小蘑菇 2021-02-15 14:32

I have an ASP.NET site that I am trying to access div elements by their ID from the C# code behind file. Essentially I want to see if a div element exists, and if so, alter its

4条回答
  •  囚心锁ツ
    2021-02-15 15:26

    You need to add a runat=server attribute to any control that you want to access in code behind. See this article for more help.

    Accessing

    from both javascript and code-behind

提交回复
热议问题