Home MVC: How to display a modal popup after calling the ActionResult
Reply: 0

MVC: How to display a modal popup after calling the ActionResult

user5129
1#
user5129 Published in September 20, 2018, 8:41 pm

I need to display a modal popup once a button is pushed, I made it with JS, but the issue that the popup is displayed before the ActionResult is executed, so I had many bugs. If I remove the JS function from the button, the page is displayed correctly, but not a popup. A full .cshtml vue.

Here is the JS part:

<script type="text/javascript">
  $('#submitupload').click(function () {
    window.open('@Url.Action("Result", "Home")', "uploadFormSuccess", 
    "height=600,width=600,modal=yes,alwaysRaised=yes");

   });
</script>

Here is the ActionResult in the controller:

[HttpGet]
public PartialViewResult Result()
{
    try
    {
        return PartialView("uploadFormSuccess");
    }
    catch (Exception ex)
    {
        _logger.Error(ex.Message);
        return PartialView("Error");
    }
}

Does anybody know how to "oblige" the action of the button to go to controller first and display a modal popup?

share|improve this question

1 Answer 1

active oldest votes
up vote 0 down vote
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.30269 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO