tags:

views:

275

answers:

3

Hi

I need to hide the modal popup on client using javascript.

if i use
$find('ModalPopupExtender1').hide();

for hiding it is throwing an error saying

'null' is null or not an object'

its urgent, can any body help me out of this prblem.

thanking you.

A: 

It sounds like the $find call is probably not finding the behavior. Can you change the code to:

var behavior = $find('ModalPopupExtender1');
var undefined;
if (behavior !== undefined)
   alert("found");
else
   alert("not found");
Bryan Matthews
Thanks Bryan for your reply.The issue was, i have not set BehaviorID.After setting the BehaviorID , it is working perfectly.thanking you.
kumar
A: 

There are 2 options to solve this:

1)Change/add a behaviorID to the modalpopup and name it ("ModalPopupExtender1")

2)Change your script to this:

$find('<%= ModalPopupExtender1.ClientID%>').hide();

kumar
A: 

There are 2 options to solve this:

1)Change/add a behaviorID to the modalpopup and name it ("ModalPopupExtender1")

2)Change your script to this:

$find('ModalPopupExtender1').hide();

Snehal

related questions