-1

I am working on some browser neutral issue and I see code is in window.open() for new window, it works in IE-11(but not modal pop-up) and not in any other browsers such as Edge, Safari, Chrome.

the currently the window.open() is not of Modal type so is there any way I can change this window to modal and could work in all above mentioned browsers in a easy way ?

here is the code

function ShowAbbreviationDefinition_onclick()
    {
        var windowOptions = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,height=400,width=400,left=300,top=150"
        window.open("../UserControls/Somepage.aspx", "", windowOptions);
    }

Thanks.

3
  • Use jquery dialog or anyother modal dialogs. Commented Jan 4, 2017 at 5:49
  • what about set target=_blank in window.open()? Commented Jan 4, 2017 at 5:49
  • There are lots of different modal/dialog scripts and plugins readily available all over the web. Did you even try looking? Commented Jan 4, 2017 at 5:50

2 Answers 2

0

If you want a native ASP.NET component, you can refer to MSDN blog posts.

Otherwise, jQueryUI provides an entire framework with a completely client-based modal called Dialog.

You'll want to understand that an iframe will need to contain the Somepage.aspx URI. See this other answer.

Sign up to request clarification or add additional context in comments.

Comments

0

You can try using jQuery UI dialog. For that you need to add jQuery UI css and js files to your page.

<div id="dialog" style="display:none;"></div>

function ShowAbbreviationDefinition_onclick(url){
    $("#dialog").append($("<iframe />").attr("src", "UserControls/Somepage.aspx")).dialog();
}

1 Comment

jQuery doesn't have a dialog, jQueryUI does but also requires including source files which isn't mentioned here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.