Page view counter

How Do I: Use the ASP.NET AJAX ModalPopup Extender Control?

Learn how to use the ASP.NET AJAX ModalPopup extender control that comes with the ASP.NET AJAX Control Toolkit. In this video the ModalPopup extender is used to pop open a standard ASP.NET Panel control as a modal dialog box.

Presented by Joe Stagner

Duration: 10 minutes, 29 seconds

Date: 26 January 2007

Watch the video   |   Download the video   |   Get VB code  or  C# code

Video downloads: WMV | Zune | iPod | PSP | MPEG-4 | 3GP

Audio downloads: AAC | WMA | MPEG-4 | MPEG-3 | MPEG-2

Comments : 53

Leave a Comment

mpdan : On March 07, 2008 4:26 PM said:

You guys make this too easy!

JoeStagner : On March 15, 2008 12:51 PM said:

:) Thanks !!!

guangzhou_2007 : On March 18, 2008 4:31 AM said:

These are good things for me!! Thank you

PsionSharp : On March 20, 2008 11:07 AM said:

That's what I'm talking about. Easy.  Thanks.  

I got one for you.

Adding context menu to a ListBox.

JoeStagner : On March 25, 2008 2:43 PM said:

mmmmm.. Can yo ugive me an example ?

Feel free to email me via my blog at www.joeon.net

fsilva : On March 26, 2008 10:38 PM said:

Joe:

In the past I used Telerik RAD controls which allowed ModalPopups to contain individual web pages from either the same project/solution or a different web site page altogether.  

I don't have use of that assembly anymore and was wondering if there's a way to accomplish the same thing using the AjaxControlToolkit ModalPopup?

All of my searches show that this AJAX control supports panels exclusively.  I actually placed an iFrame within a panel, within a ModalPopup but have a very buggy-javaScript parent page.

I am desperate... any ideas on how to do this?

Thanks in advance

darthocellaris : On March 28, 2008 11:53 AM said:

How would you set it up so that you can pass in a dynamic string to display in the ModalPopup? I'm trying to replace the javascript 'alert' function I use now for popup messages so I can use CSS to make my popups nicer.

I'm guessing DynamicServiceMethod has something to do with my question?

dtsob75 : On April 03, 2008 5:33 PM said:

Joe,

I have a need to use the modalpopup, but the code I need to use is all in a separate ASPX page.  I can change that to an ASCX user control. WOuld that work as the popup control?  How would I set the controlID (ok and cancel), since they would be controls in the ASCX?

Any help would be apprciated.

jonefer : On April 04, 2008 5:07 PM said:

I'd like to use the Modal Popup Extender triggered by a link button in a GridView Control... is this possible?

dtsob75 : On April 07, 2008 10:12 AM said:

I found several articles on using from within a gridview.  Here are a couple:

www.aspdotnetcodes.com/Ajax_ModalPopup_PostBack_GridView.aspx

aspalliance.com/1509_Working_with_ModalPopup_Ajax_Control.all

fluffy_vb : On April 07, 2008 4:37 PM said:

I just did a gridview on a modal pop today. It's AWSOME. I just used the regular basic panel popup scenario, placed a LINQ datasource on the page and wired it to a gridview on the panel to be popped up. Works great though I haven't figured out how to get the ModalPopupExtender OkControlID wired to the row select on the gridview. I'm on the trail of using a template field to select the row so I can have a named control......  If you figure that one out let me know.

realjuancho : On April 08, 2008 1:00 PM said:

i just did this example and run it on my 2 different browsers to find out that when following these exact steps Internet Explorer 7 does not show the modal pop up while Mozilla does. does anybody know why??

to Joe: thanks for this very useful videos

javed_alam786 : On April 14, 2008 11:46 AM said:

Hi Joe, i am trying to get the   Modal Popup Extender triggered when the user clicks  on a hyperlinked ProductID field in a gridview. How should i approach this.

JoeStagner : On April 14, 2008 8:31 PM said:

realjuancho - can you emal me a sample ?

javed - what do you want to happen when the user clicks? Feel free to email me via the COntact form on my blog at www.joeon.net

javed_alam786 : On April 15, 2008 4:12 AM said:

I just want a AJAX popup window with Close button. The popup will only display the product details.

masfenix : On April 16, 2008 11:40 PM said:

To javed:

Why dont you just put a small close button? or even take a small "x" image and use CSS to position it on top of the panel?

I suppose the cancelControlID captures the click event on any control to close. I could be terribly wrong though.

javed_alam786 : On April 17, 2008 5:15 AM said:

Masfenix:

What you are saying is correct but my intention is to display records in a GridView with ProductId as HyperLinked Field. When the user clciks on this hyperlink i want to pop an AJAX Modal PopUp to display Product detail and a Close Button only, i am having no problem on ButtonClick event but i just cant get this thing to work on hyperlink.

migs8teen : On May 09, 2008 1:20 AM said:

sir joe,

good day..

can you help me with my problem i find this tutorial so helpful..

but my problem is how can i associate this modal pop up extender in my grid view and having a database in ms access..

pls help me sir.. i wanted only my program that if i click on a current record in gridview it will pop out all the records of the name you click in details view nad there you can edit,cancel and update that record that i click..  pls help me sir..

thanks in advance sir..

migs

NEWBIE

migs8teen : On May 09, 2008 1:30 AM said:

sir joe,

good day..

can you help me with my problem i find this tutorial so helpful..

but my problem is how can i associate this modal pop up extender in my grid view and having a database in ms access..

pls help me sir.. i wanted only my program that if i click on a current record in gridview it will pop out all the records of the name you click in details view nad there you can edit,cancel and update that record that i click..  pls help me sir..

thanks in advance sir..

migs

NEWBIE

ajay333 : On May 14, 2008 11:45 AM said:

migs8teen, this is what you might be looking for:

www.aspdotnetcodes.com/Ajax_ModalPopup_PostBack_GridView_Sample.aspx

ketaki510 : On May 27, 2008 2:48 AM said:

hi,

I need to use the modal popupextender in my application. but I have a master page in my app. and I need to add the script for the OK button. where and how can I add the script to my contentplace holder?? could you please help me?? and I need to call the button_click method of the OK button of the modal popup in which i interact with the database. How can I do that??

JoeStagner : On May 27, 2008 1:38 PM said:

So do you want the code in the masterPage or in the deriving page ?

Wardgp : On May 27, 2008 4:05 PM said:

Good Stuff Joe!  I'm working my way through all of these using VS2008.  I noticed that the 'filter' and 'opacity' properties are getting flagged with a 'is not known CSS property name.'  I'm guessing this is a VS2008 bug as the opacity really happens when I run it, but I thought I would check to see if there is a more up-to-date term that should be used here.

ketaki510 : On May 28, 2008 2:11 AM said:

i want the code in the deriving page...not the master page..

JoeStagner : On May 30, 2008 3:35 PM said:

Ward - your are correct, I think it'sjust an Intellisence / Schema glitch.

qysan : On June 05, 2008 7:07 AM said:

Hi there

Is it possible to add multiple ModalPopupextenders to the Same page.

When I try this only the first one works.

I'am using VS2008 - Toolkit 3.5

Regards

nak.get : On June 17, 2008 3:26 AM said:

Thanks Stagner,

It is really cool tool!

Can I gray out part of a page using tool?

In my page I have Treeview, I want to keep it active while              displaying the modelpopup, is it possible?

Thanks.

vasireddybharath : On June 26, 2008 3:33 PM said:

Hi Joe Stagner,

   Its really good video. I have a question for you. I am using ModalPopup Extender in our application, through coding I am making the extender visible, ModalPopupExtender.Show() method. Its working fine when I am executing it with out using a control like button. If in the button click if I am using the same statements its not working. Can you please tell me what might be wrong in my coding.

Thanks & Regards

Bharath Reddy VasiReddy

vasireddybharath : On June 26, 2008 3:55 PM said:

Hi Joe,

    One more question, if I am removing display:none attribute from the panel then it is working once. after that is does'nt show up.

Thanks

Bharath Reddy VasiReddy

fadavi : On July 12, 2008 7:48 AM said:

I can`t do this because my VisualStutio 2008 dosen`t know the <ajaxToolkit:ModalPopupExtender ...

how can do this?

ryandebraal : On July 15, 2008 1:28 PM said:

When I create a modalpopupextender, it pops up in center of screen - how do I make it pop up relative to the control that "spawned" it?

My Ajaxtoolkit control doesn't have a "position" property -instead of <Ajaxtoolkit:modal...> it's <cc1:modal...>

Is that something else?

fxjamy : On July 15, 2008 3:57 PM said:

Hi

I want to update WYSIWYG editor (with HTML code) using ModalPopup. I am not even able to update label/textbox.

can anybody PLZ help ?? ?? ??

bullszi : On July 17, 2008 8:47 AM said:

VS 2008 and AjaxTK 3.5

The modal popup just closes when i try to update/refresh some data inside.

Next time I open it the update did occur the data/ change is there - but why didnt the modal popup stay open?

This used to work perfectly with .Net 2.0 I use it constantly, now nothing works.

I have run SP1(beta) but this changes nothing - whats going on?

Please help...

praveen.battula : On July 18, 2008 1:12 AM said:

What is the case, if i have huge data on my web page.

The Modal popup extender stops working and the error message is

Stop running the script?

A script on this page causes Internet Explorer running slowly.If it continues to run, your computer may become unresponsive.

The above error message coming in IE only. in mozilla it's working very fine.

Can you please tell me some solution.

thanks

-praveen.

himavath : On July 28, 2008 3:41 AM said:

I wanted to use the popup control for multiple Modle Popup extenders is it possible ?

cmshafi : On August 03, 2008 12:20 AM said:

Wow, great, but I'm having a problem.

It works fine but

I have used a flash animation clip in my web page. the popup showing behind the flash animation. Is there any way to solving this problem? Thanks in advance.

pnv.ravikiran : On August 05, 2008 6:52 PM said:

its a fantastic video, it helped me a lot in solving a critical problem :) thanks Joe

cv_vikram : On August 06, 2008 1:28 PM said:

It is simple and good....

jayhawker : On August 18, 2008 12:32 PM said:

Can I ask what product you used to create these videos?

Thanks

vimal.vincent : On August 20, 2008 5:20 AM said:

I am  calling a  calendar popup (web user control) from the Model Popup Extender panel , the calendar popup is not comming, please help me..

nanani : On August 22, 2008 4:08 PM said:

Hi,

I am using this Modal dilog box. The example shown here is client side and what trying to implement is a server side modal dialog. Here is the scenerio that i had. Once i click on the link, the modal dialog opens and i need to add 2 dropdowns in which the second dropdown loads based on the first dropdown selected. And based on the second dropdown value i need to change the the main page content.

Now my problem is when i am selected the first drop in the modal dialog, the modal dialog disappears...means when the post back occurs the modal dialog disappears..

any help on thi issue is greatly appreciated...

thanks..

S.Pirashanth : On August 28, 2008 7:35 AM said:

Many thanks Joe for the excellent video series

vasireddybharathreddy : On September 11, 2008 12:20 PM said:

Hi,  

I have a question for all of you guys...I want to show the modalpopup up if the condition is satisfied and if the condition is not satisfied then i don't want to show the modalpopup.

Thanks in advance.

Mitesh : On September 16, 2008 9:04 AM said:

We are consuming a webservice in our website and at one point it will take about 30-40 second do display the data.

To keep user happy I want to show a modal popup box which will display rss feed, while in background the data is still being fetched.

My question is when it displays the modal popup box, will it continue to fetch the data in the background and is it possible to display something on modal popup box when data is received so that user knows that data is there.

Any idea, example would be appreciated.

Thanks

jabcoco : On September 16, 2008 2:19 PM said:

Hi Joe, i'm quit new with AJAX, and want to know something.

My problem is that the modalpopupexterder execute a postback on server.

The problem with the server postback is each controls are recreated and "x query" to database are also made. I know i can do some caching here but...

Any way to open a ajax modal popup with some javascript parameters that are passed to the "updated panel" postback when the popup show?

Exemple, the main page show 1 listbox and 1 button. The listbox show "Description" and have "ID" has values. When the button is clicked the modalpopup will show more information about the selected values. So the button should pass to the modalpopup someparameters, then the modal should have a updatepanel or something like this who will call back the server to render the appropriate details content of specify ID.

Anybody can help?

thanks

msaliusa : On September 18, 2008 2:28 AM said:

Thank Joe.

And all participant thanks for your valueable comments.

Mohammed

abhilashca : On October 04, 2008 1:39 AM said:

Oh!

This is an insane control.

I love it.

Thankz Joe.

lapdragon : On October 09, 2008 2:02 PM said:

I've used this AJAX control to open images or other panels.  Is it possible to open a pdf in a modal window?  I'm guessing using an IFrame or something to load the document.  Suggestions?

skaimal : On October 15, 2008 12:11 PM said:

I have a modal popup in the masterpage which displays a usercontrol. How do i link the CancelControlID of the popup to the usercontrol button. Ur help will be appreciated

sali1982 : On October 17, 2008 6:38 AM said:

Hi Joe,

Please help me.  I am using modalpopup it is fantastic, and I do not have any problem with Firefox. however, in IE7 I get some problems. It does not lock the main page, no color is made for it,(It guess BackgroundCssClass="modalBackground" does not affect) and below my page a gray color is created and extends my web page in terms of height!!! what can cause this problem?  :(

Thanks very much

chaikao : On October 20, 2008 9:01 AM said:

Does any know how to prevent the popup layer to close when there is a postback event on the layer.

Example, once the popup is applied, and I select a country on the dropdownlist. This country doropdownlist will perform postback and get the list of the state/province. But it seems like every time it has a postback, the layer page is closed.

thanks,

Chai

a1t-f4 : On October 22, 2008 9:30 PM said:

I need to assign a value that the user inputs in a modal popup to a global variable. My problem is when the modalpopup is closed so is the value in the global variable that is assigned? any help?

zerocoolZeroCool : On October 23, 2008 10:09 AM said:

Hi Joe,

I am wondering when you could reach me.

I am having a Master Page and a Child Page that have many

Asynchronous Post-back controls. ( Buttons, Textboxs, GridViews and so on)

So, i need to implement Ajax Progress to each and every Post-back control. In that user may Visualize which control is in Progress ( in Post back mode) and so on.

So in this way My page may have many Postback control user may triggers the event and showing each and evry control is in Progress ( in Post back mode).

This is great if you could provide me a working sample.

Thank you any way.

ZeroCool.

Leave a Comment

You must be logged in to leave a comment. Click here to log in.

Microsoft Communities