Click here to Skip to main content
15,902,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

Here is my issue, I have a ASP.NET 4 App with VB back bone and am using a MasterPage.
What I am wanting to do is have a button on the MasterPage that triggers a modal to open on any page that is open in the application.
I thought it would be as easy as adding a modal to the MasterPage and putting a button in the header with modal.Show() annoyingly it seems that this did not work.
I would really appreciate a direction to start walking in on this, any tips are welcome.

Thanks,

Caz
Posted

1 solution

Hi Caz,

As I know there is no such a concept for modal in asp.net! you can show a modal via Javascript in client side but not in server side.

What do U "mean by to open on any page that is open"?
If you mean diffirent page in different tab, page or browser, basically you can not do it easily. ( it is possible but you need to write client side script and do some server side programming)

one approch might be poling server in every page and if a certain thing is set on your server side, show a dialog on your page.
 
Share this answer
 
Comments
Zac Newman 15-Feb-12 20:05pm    
I am creating the modals using the AjaxControlToolkit (Sorry should have mentioned that before) and the modal function in that. Put putting a modal on the MasterPage in theory should open on every page in the application since every page inherits the MasterPage, but that isn't the case creating a modal on the MasterPage and then a button to show it only results in a runtime error.
aidin Tajadod 16-Feb-12 12:30pm    
Zac, I don't have much experience with AjaxControlToolkit, but at the end, it should be translated to some client side script(Javascript). So although all of your pages inherits from your masterpage, it doesn not mean when you click on a page, all other page should show your message! As you know, in [normal] web pages, after they have downloaded to the client side (by the browsers), they aren't aware of what is happening on server side. it means, even if your server goes down, your clients won't underestand unless they send a request to your server! That is the reason I said you need some kinds of polling mechanism on your pages to find out what is happening on your server and act accordingly.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900