1) Assign a BehaviourID to the ModalPopupExtender using the BehaviourID attribute.

BehaviorID ="ModalBehaviour"

2) Use the $find method to get a handle to the Modal Popup Behaviour .

$find ("ModalBehaviour").

3) Call your hide and show methods on the acquired handle.

4) The Javascript would look like this.

 

<script language="javascript">

function ShowModalPopup()
{
  $find("ModalBehaviour").show();
}

function HideModalPopup()
{
 $find("ModalBehaviour").hide();
}

</script>