How do you set the “Visible” property of a ASP.NET control from a Javascript function?

后端 未结 9 666
不知归路
不知归路 2021-01-17 09:49

Bascially I want to know the best way to hide/show an ASP.NET control from a Javascript function. I figured I would just access the control in Javascript using:

<         


        
9条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-17 10:08

    You can use the display property for this. But as Jason noted, this is a DHTML DOM (client-side) property that is completely independent from the ASP.NET (server-side) Visible property which controls rendering.

    theControl.style.display = "none";
    

    Display Property

提交回复
热议问题