0

I want to Open a Crystal Report on Pop up Window on Menu Click

<%= Html.ActionLink("Display Name", "Action","Controller", new { target="blank"})%>

This Above Code works, but it opens on a next tab.I need to open on a pop-up window.

4b0
  • 21,981
  • 30
  • 95
  • 142
Vishal
  • 11
  • 1
  • 2
  • 5

3 Answers3

1

I have achieved by using the below code.

$('a.edit').click(function () {
                var url = $(this).attr('href');
                window.open(url, "popupWindow", "width=900,height=600,scrollbars=yes");
                return false;
            });

<%= Html.ActionLink("Display Name", "Action","Controller", new { @class="edit"})%>
mjwills
  • 23,389
  • 6
  • 40
  • 63
Vishal
  • 11
  • 1
  • 2
  • 5
0
target="blank"

this thing is specially used for opening in new tab.....If you copied it unknowingly then remove this and its gonna open in same tab

Shubham
  • 443
  • 2
  • 10
0

There are a couple of ways doing it. Use partial view:

steps: 1. create a partial view to load report. 2. Decorate partial view div with bootstrap model class 3. on click of menu anchor write something below.

var reporturl = '/Home/Report';  
$(function () {  
    $("#reportMenu").click(function () {  

        var options = { "backdrop": "static", keyboard: true };  
        $.ajax({  
            type: "GET",  
            url: reporturl,  
            contentType: "application/json; charset=utf-8",  
            data: { "Id": id },  
            datatype: "json",  
            success: function (data) {  
                $('#reportDiv').modal('show');                    

            },  
            error: function () {  
                console.log("Report load failed.");  
            }  
        });  
    });  
    $("#closbtn").click(function () {  
        $('#reportDiv').modal('hide');  
    });        
});  
 </script>