Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ModalPopupExtender display

Posted on 2013-12-19
7
Medium Priority
?
238 Views
Last Modified: 2013-12-19
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
0
Comment
Question by:dbote
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 39730107
Instead of setting the button visibility property to false try setting the style display attribute of the button to none like :

mybutton.style = "display:none"
0
 
LVL 1

Author Comment

by:dbote
ID: 39730172
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?
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 2000 total points
ID: 39730197
mybutton.style.add("display","none")

to show the button again

mybutton.style.remove("display")
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Closing Comment

by:dbote
ID: 39730245
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
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 39730284
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.
0
 
LVL 1

Author Comment

by:dbote
ID: 39730315
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
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 39730318
Glad to help.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question