Solved

ModalPopupExtender display

Posted on 2013-12-19
7
222 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
Comment Utility
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
Comment Utility
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
Comment Utility
mybutton.style.add("display","none")

to show the button again

mybutton.style.remove("display")
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Author Closing Comment

by:dbote
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Glad to help.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now