Skip to main content

NullReferenceError for Html.Sitecore().Rendering in Ajax Calls

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

enter image description here

enter image description here

Html.Sitecore().Rendering in Ajax Calls

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

I get an error - "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

enter image description here

enter image description here

NullReferenceError for Html.Sitecore().Rendering in Ajax Calls

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

I get an error - "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

enter image description here

enter image description here

added 178 characters in body
Source Link

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

I get an error - "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

enter image description here

enter image description here

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

I get an error - "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

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

I get an error - "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

enter image description here

enter image description here

added 180 characters in body
Source Link

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

I get an error - "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

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

I get an error - "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

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

I get an error - "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

Source Link
Loading