PC Review


Reply
Thread Tools Rate Thread

Ajax ModalPopup extender not closing

 
 
Carlos
Guest
Posts: n/a
 
      23rd Sep 2009
Hi,

I just built a page which references a panel to popup using
an Ajax modalpopup extender control. The problem that I have
has to do with the Cancel button. When pressed it does not close the
popup. I have tried to just define the CancelControlID property without
the OnCancelScript property, and it does not close it.

Can someone help?

Thanks,

Carlos.


 
Reply With Quote
 
 
 
 
Carlos
Guest
Posts: n/a
 
      23rd Sep 2009
Hi again,

never mind, I just did not referenced the extender properly when
handling the event to close it when the cancel button was pressed.
I forgot that I had to include the master page prefix when locating the
control.
i.e.

function onCancel() {

var modal = $find('ctl00_Contentplaceholder2_ModalPopup');

modal.hide();

}



"Carlos" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I just built a page which references a panel to popup using
> an Ajax modalpopup extender control. The problem that I have
> has to do with the Cancel button. When pressed it does not close the
> popup. I have tried to just define the CancelControlID property without
> the OnCancelScript property, and it does not close it.
>
> Can someone help?
>
> Thanks,
>
> Carlos.
>



 
Reply With Quote
 
Carlos
Guest
Posts: n/a
 
      24th Sep 2009
Thank you so much for the clarification Mark.
Where can I go to find the theoretical background about this?

Thanks again!

Carlos


"Mark Rae [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "Carlos" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>> never mind, I just did not referenced the extender properly when
>> handling the event to close it when the cancel button was pressed.
>> I forgot that I had to include the master page prefix when locating the
>> control.
>> i.e.
>>
>> function onCancel() {
>>
>> var modal = $find('ctl00_Contentplaceholder2_ModalPopup');
>>
>> modal.hide();

>
> Do not UNDER ANY CIRCUMSTANCES do this. The munged element name is not
> guaranteed to be the same forever. Many things can cause it to change,
> which will break your code completely.
>
> Instead, do this: var modal = $find('<%=ModalPopup.ClientID%>');
>
>
> --
> Mark Rae
> ASP.NET MVP
> http://www.markrae.net



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
AJAX Animation Extender vcuankitdotnet Microsoft ASP .NET 0 18th Mar 2008 08:52 PM
AJAX ModalPopup To Confirm Dropdownlist Change Ben Microsoft ASP .NET 2 16th Mar 2008 01:40 PM
ajax modalpopup extender help Jamie Sutherland Microsoft ASP .NET 1 5th Dec 2007 04:23 AM
AJAX Calendar Extender mianiro Microsoft Dot NET Framework 0 24th Jul 2007 04:00 PM
Ajax ModalPopup Extender Nemisis Microsoft ASP .NET 0 6th Feb 2007 10:54 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:01 AM.