I am adding another view page (with Ajax Request) into my existing view Page, like in this way -> $(“divId”).html(data);
Here data is my View Page which I am getting with ajax call.
My question is Can I remove ‘Layout’ or set it as Layout = Null, for this Ajax returned View page?
I am adding another view page (with Ajax Request) into my existing view Page,
Share
In controller action you can return a
PartialView, this will only send the HTML from the view to the client without the code from the Layout. You may implement your Action this way:So you can use the same Action for a normal and an Ajax request.