How to specify javascript to run when ModalPopupExtender is shown

前端 未结 8 741
有刺的猬
有刺的猬 2020-12-28 13:15

The ASP.NET AJAX ModalPopupExtender has OnCancelScript and OnOkScript properties, but it doesn\'t seem to have an OnShowScri

8条回答
  •  南笙
    南笙 (楼主)
    2020-12-28 13:53

    hmmm... I'm pretty sure that there's a shown event for the MPE... this is off the top of my head, but I think you can add an event handler to the shown event on page_load

    function pageLoad()
    {
        var popup = $find('ModalPopupClientID');
        popup.add_shown(SetFocus);
    }
    
    function SetFocus()
    {
        $get('TriggerClientId').focus();
    }
    

    i'm not sure tho if this will help you with calling it from the server side tho

提交回复
热议问题