I need to update page renderings based on search results using ajax call. I have written a method to get rendering collection based on filter and when I call Html.Sitecore().Rendering via loop in view like below:
@Html.Sitecore().Rendering("{450270A9-640A-46B4-80ED-02CCCCCB2549}", new { DataSource = "{C3D52B5F-F236-49DF-A027-6432FE2F80FE}" })
@Html.Sitecore().Rendering("{450270A9-640A-46B4-80ED-02CCCCCB2549}", new { DataSource = "{C3D52B5F-F236-49DF-A027-6432FE2F80FE}" })
I get an error - "Object reference not set to an instance of an object""Object reference not set to an instance of an object"
only for ajax call but above code works for page request.
I researched about this issue and I didn't get any solution.
Is it possible to call Html.Sitecore().Rendering using Ajax