dbote
asked on
ModalPopupExtender display
I have a ModalPopupExtender on an aspx page that is displayed by a button. The button is only visible if certain conditions about a patient exist. If these conditions do not exist I would like the button to not display which would then not allow the ModalPopup to display either.
However, whenever I set the button visible property to false the ModalPopup is no longer a Modal Popup but a regular table on the page which always displays.
AjaxControlToolkit - 4.1.7.123
Although I do not think it matters in this case I am using VB.NET as the code behind page.
Does anyone know a work around to this behavior?
Thanks in advance,
db
However, whenever I set the button visible property to false the ModalPopup is no longer a Modal Popup but a regular table on the page which always displays.
AjaxControlToolkit - 4.1.7.123
Although I do not think it matters in this case I am using VB.NET as the code behind page.
Does anyone know a work around to this behavior?
Thanks in advance,
db
ASKER
That definitely suppresses the ModalPopup but...
I have a style for the button in a CSS file that gets applied to buttons in the application. How can I conditionally apply "display:none" in code?
I have a style for the button in a CSS file that gets applied to buttons in the application. How can I conditionally apply "display:none" in code?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Simple and easy to use.
I have never approach styles in that manner. I'm guessing I can evaluate the Styles Item collection to see if styles exist?
Thank you for your assistance.
db
I have never approach styles in that manner. I'm guessing I can evaluate the Styles Item collection to see if styles exist?
Thank you for your assistance.
db
Yes you can evaluate the styles collection to see if a style exists, however I think if you add a style that already exists it overwrites its current value, so haven't really found the need to evaluate the collection in that way.
ASKER
I was more concerned about evaluating to remove the style but the options are a plenty.
There are so many things that just opened up in my world from this little tidbit of information.
Thanks again!
db
There are so many things that just opened up in my world from this little tidbit of information.
Thanks again!
db
Glad to help.
mybutton.style = "display:none"