Bringing up a modal  window from an aspx page

Posted on 2005-04-20
Last Modified: 2011-10-03

I want to bring up a popup window(modal window) in an aspx page , while clicking on a link button and don't allow to click any where else until this form is closed.

I am working with C#, ASP.Net and Java Script.

Question by:Dileepgn
    LVL 15

    Expert Comment


    There is a site my instructor put up with coding examples. Download the code for the ASP.Net pages( Modal with Web Services )

    LVL 29

    Accepted Solution

    <%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="popupWindow.WebForm1"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <meta name="vs_targetSchema" content="">
    function popup() {
      var mywin ="http://localhost/mypage.htm","test","height=200,width=400,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no");
    <body ms_positioning="GridLayout">

    <form id="Form1" method="post" runat="server"><input id="b1" style="Z-INDEX: 102; LEFT: 41px; POSITION: absolute; TOP: 29px" type="button" value="Open Popup" name="b1" onclick="popup();">


    LVL 19

    Expert Comment

    window.showModalDialog("test.aspx", window);

    Should work if I am not totally daft here...


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
    I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now