1
I need to call a Partialview in my Javascript but I’m not sure how.
I’m using a plugin that in the TARGET variable gets a Div. And this in my case, this Div I put being a Partial View. My JS is like this:
var modal = new Custombox.modal({
content: {
effect: 'blur',
target: '#MinhaDiv',
}
}).open();
The idea would be to do something close to that:
var modal = new Custombox.modal({
content: {
effect: 'blur',
target: @Html.Partial("_Unidade", Model),
}
}).open();
Of course this example will not run pq I am using the helper within Javascript. But the example is to convey my need.
So I need Javascript to load a Partialview and still pass a model to her. This is possible?
Yes it is possible, but it should be so, when loading your page that contains this
div
already load the partial directly to it, and after you call via javascript the same was already ready to be used– novic