in my aspx page I have this div..
<div id="downloadableProducts" runat="server"><a href="#">Downloadedable Products</a></div>
I am trying to change the css in the code behind like this..
downloadableProducts.Style("display") = "none";
but this does not work, I get an error and red underline under downloadableProducts
in the code behind and it says 'The name 'downloadableProducts' does not exist in the current context
'
What am I doing wrong?
You need to add runat="server"
to the div and access it as a HtmlControl
in your codebehind. For example:
HtmlControl div1 = (HtmlControl)Page.FindControl("downloadableProducts");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With