So I have two options here. on an asp button with id="Btn1" I have OnClientClick="popConfirm()" or I could do this from code behind Btn1.OnClientClick = String.Format("popConfirm()") and so forth. I want to be able to master both here but ultimately choose
either one in different scenarios.
Problem 1: The problem I'm facing that I can't stop the code behind version to stop and wait for a confirm button clicked in the modalpopup. It will just continue to run code. Is there something I'm doing wrong here. How can I get it to stop and wait and
listen that confirm has been clicked?
Problem 2: If I use javascript function popConfirm(), its not finding the ajaxmodalpopup control and I've even (I think) properly resorted to using the BehaviorID. It just returns null object found. Here below is this version.
Hi, yes that worked out along with another small adjustment, but now with half of this problem solved, I get the following very bizarre manifestation.
I have two pages completely identical that use this function and button. On one page this works perfectly on the other for some reason the button is not passing the source (source being the buttonId. it works on the other page with "this". Is there any
reason why its not passing or defining the source assigned to the onclientclick value from the button? and why would this work on another page? could this be DOM issue? its simply not passing the value to the javascript. by the way the modal exists, checked
that so that's not it.
Here is the adjusted function and button that works on one page but not the other. So it hangs on this._popup.show(); stating the following
JavaScript runtime error: Unable to get property 'show' of undefined or null reference
update... I added a watch to these and the values for popup and source are correctly passed. So why the undefined error?
I figured this out for those of you interested. One page had EnableEventValidation="false"
set to true and the other didn't. Since this is not a critical operation I set them to false and it worked.
Member
28 Points
188 Posts
not showing ajax modal popup from javascript.
Nov 01, 2014 08:00 AM|dolittle|LINK
So I have two options here. on an asp button with id="Btn1" I have OnClientClick="popConfirm()" or I could do this from code behind Btn1.OnClientClick = String.Format("popConfirm()") and so forth. I want to be able to master both here but ultimately choose either one in different scenarios.
Problem 1: The problem I'm facing that I can't stop the code behind version to stop and wait for a confirm button clicked in the modalpopup. It will just continue to run code. Is there something I'm doing wrong here. How can I get it to stop and wait and listen that confirm has been clicked?
Problem 2: If I use javascript function popConfirm(), its not finding the ajaxmodalpopup control and I've even (I think) properly resorted to using the BehaviorID. It just returns null object found. Here below is this version.
So what's going on here in both scenarios? thanks for any help
All-Star
101931 Points
20703 Posts
Moderator
Re: not showing ajax modal popup from javascript.
Nov 01, 2014 08:56 AM|MetalAsp.Net|LINK
Change this:
OnClientClick="return popConfirm();"
Member
28 Points
188 Posts
Re: not showing ajax modal popup from javascript.
Nov 02, 2014 03:47 AM|dolittle|LINK
Hi, yes that worked out along with another small adjustment, but now with half of this problem solved, I get the following very bizarre manifestation.
I have two pages completely identical that use this function and button. On one page this works perfectly on the other for some reason the button is not passing the source (source being the buttonId. it works on the other page with "this". Is there any reason why its not passing or defining the source assigned to the onclientclick value from the button? and why would this work on another page? could this be DOM issue? its simply not passing the value to the javascript. by the way the modal exists, checked that so that's not it.
Here is the adjusted function and button that works on one page but not the other. So it hangs on this._popup.show(); stating the following
JavaScript runtime error: Unable to get property 'show' of undefined or null reference
update... I added a watch to these and the values for popup and source are correctly passed. So why the undefined error?
Member
28 Points
188 Posts
Re: not showing ajax modal popup from javascript.
Nov 02, 2014 05:46 AM|dolittle|LINK
I figured this out for those of you interested. One page had EnableEventValidation="false" set to true and the other didn't. Since this is not a critical operation I set them to false and it worked.