By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,837 Members | 1,222 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,837 IT Pros & Developers. It's quick & easy.

Firing modal popup with javascript

rrocket
100+
P: 116
I am trying to get a modal popup to display on an onblur event, but I keep getting a "'null' or is null or not an object" js error.

I have seen many examples using
Expand|Select|Wrap|Line Numbers
  1. var _popup;
  2.         _popup = $find('MPE');
  3.         _popup._show();
  4. //And
  5. $find('MPE')._show();
  6. //And
  7. $object('MPE')._show()
  8.  
But none of them work. I just need to fire the Modal Popup on the client side...

Code for the Modal Popup:
Expand|Select|Wrap|Line Numbers
  1. <cc1:ModalPopupExtender ID="MPE" runat="server"
  2.     TargetControlID="TestButton"
  3.     PopupControlID="pnlWeightMessage"
  4.     BackgroundCssClass="modalBackground" 
  5.     DropShadow="true" 
  6.     OkControlID="BacktoForm"
  7. />
  8.  
Thanks
Apr 23 '08 #1
Share this Question
Share on Google+
1 Reply


rrocket
100+
P: 116
I figured it out.

Here is the info if anyone else has the same issue:
Expand|Select|Wrap|Line Numbers
  1. <cc1:ModalPopupExtender ID="MPE" runat="server"
  2.             TargetControlID="TestButton"
  3.             PopupControlID="pnlWeightMessage"
  4.             BackgroundCssClass="modalBackground" 
  5.             DropShadow="true" 
  6.             OkControlID="BacktoForm"
  7.             BehaviorID="MPE" <!-- Added behavior to the control and named it the same as the ID-->
  8.         />
  9.  
Expand|Select|Wrap|Line Numbers
  1. //Once I added the behavior this
  2. $find('MPE').show();
  3. //worked to call the Modal Popup from the javascript function
  4.  
Apr 23 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.