Solved

ModalPopupExtender display

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

to show the button again

mybutton.style.remove("display")
0
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
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…

624 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