How to load more than a partial view with a click event?

0

I know there are several ways to load a partial view with the event of a button, example:

<script type="text/javascript">
$(document).ready(function() {
    $("#view1").click(function() {
        $("#ajaxpanel").load("<%=Url.Action("View1") %>");
    });
    $("#view2").click(function() {
        $("#ajaxpanel").load("<%= Url.Action("View2") %>");
    });
});
</script>

The question is, how do I charge more than a partial view in the same event of a button?

    
asked by RSillerico 02.12.2016 в 01:33
source

1 answer

0

Question:

  

how do I charge more than one partial view in the same event of a button?

Answer:

With the code that you could already do, for example, the following:

$(document).ready(function() {
    $("#view1").click(function() {
        $("#ajaxpanel").load("<%=Url.Action("View1") %>");
        // Ademas de View1 cargamos 2 vistas mas
        $("#ajaxpanel2").load("<%=Url.Action("View1_2") %>");
        $("#ajaxpanel3").load("<%=Url.Action("View1_3") %>");
    });
    $("#view2").click(function() {
        $("#ajaxpanel").load("<%= Url.Action("View2") %>");
        // Ademas de View2 cargamos 2 vistas mas
        $("#ajaxpanel2").load("<%=Url.Action("View2_2") %>");
        $("#ajaxpanel3").load("<%=Url.Action("View2_3") %>");
    });
});
    
answered by 02.12.2016 / 16:17
source