Click here to Skip to main content
14,639,661 members
Rate this:
Please Sign up or sign in to vote.
See more:
can anyone help me to do a popup window when a button is clicked in MVC4.
Aravindba 24-Jul-13 4:03am
Anybody want to write code for u ? u have write , if any error appear in that code u have to post here and get solution ????

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Try this[^]

Hope this helps
Minnu Sanju 26-Jul-13 6:54am
when i looked at this link i cannot run the source code provided. an u please suggest me the code to do a simple popup just to show a message, when a button is clicked.
Jameel VM 26-Jul-13 6:59am
did you try jQuery UI pop up? it is simple and easy to use.
Minnu Sanju 26-Jul-13 7:33am
ya i tried that then i an getting error:"Microsoft JScript runtime error: Object doesn't support this property or method"
Jameel VM 26-Jul-13 7:34am
in which line?
Jameel VM 26-Jul-13 7:35am
did you add the jQuery plugin?
Minnu Sanju 26-Jul-13 7:44am
in line $(function () { $("#dialog").dialog(); });
Minnu Sanju 26-Jul-13 7:45am
i am new to jquery and i don't know what is that
Minnu Sanju 26-Jul-13 7:47am
My code is like this:
in controller:

public class PopUpController : Controller
// GET: /PopUp/

public ActionResult Index()
return View();

public ActionResult PopUp()
return View();

in view:

<link href="../../Content/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery-1.9.1.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui.js" type="text/javascript"></script>

<div id="dialog" title="Basic dialog">

<script type="text/javascript">
$(function () { $("#dialog").dialog(); });
Minnu Sanju 26-Jul-13 8:14am
please guide me
if possible
Jameel VM 26-Jul-13 8:24am
Use like this . Pass open as parameter.$("#dialog").dialog('open');
Minnu Sanju 26-Jul-13 8:29am
that also i tried earlier
Minnu Sanju 26-Jul-13 8:31am
but didn't work
Jameel VM 26-Jul-13 8:37am
when you try to pop up?on page load
Jameel VM 26-Jul-13 8:39am
please download the latest jQueryUI full library and then replace with existing one and then try

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100