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.
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.
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"})%>
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
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>