Wednesday, 21 January 2015

Set Focus on Textbox in modalPopup Panel?

<asp:ModalPopupExtender ID="ModalPopupExtenderRent" runat="server"   BehaviorID="bePopup "  RepositionMode="None"

        TargetControlID="btnshowRent" PopupControlID="divRent" Drag="true"
        PopupDragHandleControlID="divRent">
    </asp:ModalPopupExtender>


<script type="text/javascript">

    function OnPopupShow()
   {
    document.getElementById('<%= txtprovNoteSubject.ClientID %>').focus();
   }

    function SpecialProvAdd()
   {
    try
     {
    
         document.getElementById("<%=hdnGridName.ClientID %>").value = GridName
         var modalPopup = $find("bePopup"); 
                            //this is the BehaviorID from the ModalPopupExtender

          if (modalPopup != null) {
             modalPopup.add_shown(OnPopupShow);
         } 
    }
 catch(er)
 {
}
}

</script>

OnClientClick="SpecialProvAdd();$find('bePopup').show();return false;"


No comments:

Post a Comment