Creative Jar Blog RSS Feed

ModalPopupExtender & The MasterPage : One ModalPopup to bind them all

April 21, 2008 10:15 by tim

Hi

I came up with this solution a while back.  I had a GridView which i needed to display a kind of Master/Detail scenario.  I decided to use the ModalPopupextender as it forces the user to do stuff or cancel before the rest of the page executes and the ModalPopup seemed perfect.  however, having too many on the form is a bit wasteful so i went about exploring having only 1 ModalPopupExtender for my entire application and having all pages which needed it just add their stuff to it and pop it themselves, wiring up the OK and Cancel events to something both the MasterPage and the ContentPage could have access to.

It's a bit long winded to post but i attach the files here in response to a post on asp.net about a similar problem with a GridView having too many modal popups.  Feel free to post any suggestions here and i will try and update the code with any new features :¬)

You will need to add the AjaxControlToolkit.dll to the bin folder to get it working.  And it's written in Visual Studio 2008 so you might need to change the toolkit version if you're running asp.net AJAX version 1

cheers

Tim

 

ModalPopupTest.zip (5.03 kb)


Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Related posts

Add comment


 

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

January 6. 2009 14:45

Calendar

January 2009
SuMoTuWeThFrSa
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567