Neeraj Dubey Neeraj Dubey - 1 year ago 69
Javascript Question

Chrome 37 has stopped showmodaldialog support.What is use instead of that?

My web application is crashed after launched of

new version(37 and above),since chrome has stopped the support of
.However i need to implement same functionality in my web application.

I need some
return value
from popup same as
.I have designed all the popups page separately and called them from the parent page.

Answer Source

After doing lots of googling , i have find out the solution of that issue.I am using Jquery dialog present in jquery-1.9.1 version.The implementation of given below:

Add jquery library on head tag of the parent page

<link type="text/css" rel="stylesheet" href="" />
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>

Write the popup opening function,where i am creating a div and inside the div take iframe like this

<script type="text/javascript" language="javascript">
 function Open() {

        var href = "../../PopUps/FindEmployee.aspx?Page=EC";
        var obj = $('<div id="divClose"></div>');

        obj.html('<iframe id="popUpFrame" style="border: 0px; " src="' + href + '" width="100%" height="99%"></iframe>');
            autoOpen: false,
            resizable: false,
            height: 500,
            width: 650,
            modal: true,
            title: "Find Employee",
            dialogClass: 'infoDialogHeader infoDialogTitle'
        return false;
 function closeIframe() {


Now I am working on child page which is FindEmployee.aspx like ths:

<script type="text/javascript" language="javascript">

    $(document).ready(function () {

        $("[id^=BtnReturnParentPage]").click(function (e) {
            var movedElement;

            if ($("#hdnInformationType").val() == "EC") { // condition for Employee Code                   
                movedElement = window.parent.$("[id*='txtECode']");
                // cleaning textbox
                movedElement.val($(this).parent().parent().find("[id^=gvEmployeeDetails_gvlblEmployeeCode]").text()); // assing relating information




In above child page code , i have take value of $("[id*='txtECode']") textbox which is exist on parent page , and assign child page employee code value to parent page textbox.

So we need to create an element of textbox with name of txtECode on parent page so that assign the value of child page.

Hope it helps all the people who is struggling with window.showmodeldialog

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download