c# - Changing the CSS in code behind asp.net -


in aspx page have div..

<div id="downloadableproducts" runat="server"><a href="#">downloadedable products</a></div>

i trying change css in code behind this..

downloadableproducts.style("display") = "none";

but not work, error , red underline under downloadableproducts in code behind , says 'the name 'downloadableproducts' not exist in current context '

what doing wrong?

you need add runat="server" div , access htmlcontrol in codebehind. example:

htmlcontrol div1 = (htmlcontrol)page.findcontrol("downloadableproducts"); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -