Link to home
Start Free TrialLog in
Avatar of lulu50
lulu50Flag for United States of America

asked on

MVC C# popup window is not popping

Hi,
When I click on my link, it takes me to a whole new page instead of opening my partial view page in a popup window.
I’m not sure what I’m doing wrong can you please take a look and let me know
Thanks,


Controller: 
      public ActionResult RulePartialView()
        {
            CABRRulePartialViewModel model = new CABRRulePartialViewModel();

            return PartialView(model);
        }

Open in new window


Index page: 

    $(document).ready(function () {
$(function () {
            $('#dialog').dialog({
                autoOpen: false,
                width: 400,
                height:500,
                resizable: false,
                title: 'Product',
                modal: true,
                open: function(event, ui) {
                    $(this).load("@Url.Action("RulePartialView", "CareAdvanceBusinessRules")");
                },
                buttons: {
                    "Close": function () {
                        $(this).dialog("close");
                    }
                }
            });
            $("#opener").click(function () {
                $("#dialog").dialog("open");
            });
        });

  });


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

    <a id="opener" href="@Url.Action("RulePartialView", "CareAdvanceBusinessRules")">Click to open popup window </a>

Open in new window


Partial view page 

@model BCUW.Model.CABusinessRules.CABRRulePartialViewModel

<p>hello this is the partial view page</p>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lulu50

ASKER

leakim971

I thank you so much for helping me with this.

It finally works and I can see my dialog box Thank you so much

you're the best!!!!!!!
you welcome