Avatar of EricFleet
EricFleet
 asked on

Hide control in ascx.

I have a user control in an ASP.net page that I add dynamically. I need to hide another control in the user control based on a radiobutton in that same user control.

I am using a javascript function to do so. The function fires (my alert works), but the control does not get hidden. Any idea why?
function YesChecked() 
    {
        alert('whee');
        document.getElementById("ctl00_ContentPlaceHolder1_ctl40_lblMatchingFormula").style.display = "none";
    }

Open in new window

ASP.NETJavaScript

Avatar of undefined
Last Comment
EricFleet

8/22/2022 - Mon
burakiewicz

what happens if you try
document.getElementById("ctl00_ContentPlaceHolder1_ctl40_lblMatchingFormula").style.visibilty= "hidden";
EricFleet

ASKER
Same thing: nothing.
ASKER CERTIFIED SOLUTION
EricFleet

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23