Solved

ModalPopupExtender display

Posted on 2013-12-19
7
227 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
  • 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 500 total points
ID: 39730197
mybutton.style.add("display","none")

to show the button again

mybutton.style.remove("display")
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 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