80
rated 0 times
[
85]
[
5]
/ answers: 1 / hits: 19752
/ 11 Years ago, sat, october 26, 2013, 12:00:00
I have been trying for 4 days to solve this problem. But I cannot return json data into a new tab page.
My code:
<script type=text/javascript>
function CustomerId() {
var url = Home/PanelGoster; // My URL
var veri = {
Id: Id.GetValue(),
};
$.ajax({
url: /Home/PanelGoster,
type: POST,
dataType: json,
contentType: 'application/json',
data: JSON.stringify(veri),
success: function (mydata) {
if (mydata.error6 == true) {
}
else { // Success
var something = window.open(url, '_blank'); // Problem Here , it does not work
something.focus(); // Problem Here
(#MusterilerGetir).html(mydata); // Problem Here, should be displayed in a new tab
}
},
error: function () {
}
});
return false;
}
</script>
Controller:
public ActionResult PanelGoster(MyModel model)
{
var stringView = RenderRazorViewToString(PartialView, MyModel());
return Json(stringView, JsonRequestBehavior.AllowGet);
}
}
More From » json