Note that there are some explanatory texts on larger screens.

plurals
  1. POPopup won't popup in MVC
    text
    copied!<p>I'm trying to get a popup to appear from a link in an MVC page, but the popup isn't popping up. The partial view is just replacing the current page in the browser. Why isn't is just leaving my current page in place and giving me a popup? My partial view just has a few words of text in it.</p> <pre><code>@Ajax.ActionLink( "Open popup", "GetNotes", new { id = "5" }, new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "result", InsertionMode = InsertionMode.Replace, OnSuccess = "openPopup" }) &lt;br /&gt; &lt;div id="result" style="display:none;"&gt;&lt;/div&gt; &lt;script type="text/javascript"&gt; $("#result").dialog({ autoOpen: false, title: 'Title', width: 500, height: 'auto', modal: true }); function openPopup() { $("#result").dialog("open"); } &lt;/script&gt; </code></pre> <p><strong>UPDATE:</strong></p> <p>Here's the complete source (from "View Source") I'm currently trying. When I click the link, nothing happens. What's going on? Am I missing a js file or something?</p> <p>By the way, this URL is returning my partial view (currently just a couple words of plain text):</p> <pre><code>http://localhost:40353/Quote/GetNotes/5 </code></pre> <p>Here's the code:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;Test&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/Scripts/jquery.unobtrusive-ajax.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/Scripts/modernizr-1.7.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/Scripts/people.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/Scripts/kendo.web.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/Scripts/console.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/Scripts/jquery.validate.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="/Scripts/jquery.validate.unobtrusive.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;link href="/Styles/Site.css" rel="stylesheet" type="text/css" /&gt; &lt;link href="/Styles/kendo.common.min.css" rel="stylesheet" type="text/css" /&gt; &lt;link href="/Styles/kendo.default.min.css" rel="stylesheet" type="text/css" /&gt; &lt;link href="http://code.jquery.com/ui/1.8.20/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" media="all" /&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="result" style="display:none;"&gt;&lt;/div&gt; &lt;a href="#" id="OpenPopup"&gt; open popup &lt;/a&gt; &lt;script type="text/javascript"&gt; $("#result").dialog({ autoOpen: false, title: 'Title', width: 500, height: 'auto', modal: true }); $("#OpenPopup").click(function () { $("#result").dialog("open"); $("#result").load("Quote/GetNotes/5"); }); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload