Skip to main content
10 votes
Accepted

@Html.Sitecore.Field is not rendering any values

@Html.Sitecore().Field("Property Name") only works when your model is Sitecore.Mvc.Presentation.RenderingModel. You are using a custom model. To use it in your case, you will need to pass in the item ...
Chris Auer's user avatar
  • 13.1k
8 votes
Accepted

How to Connect controller rendering with Interface Template

The fix You need to specify a template in the Datasource Template field of your controller rendering. This is the field that tells Sitecore to prompt an editor to select a data source when adding a ...
Dan Sinclair's user avatar
  • 5,394
6 votes
Accepted

Context.Site.Name changes to wrong site when using AJAX call

Sitecore does not resolve the Sitecore.Context properly in case of the HttpPost through AJAX requests. I would suggest to add the siteName as a parameter to your Action as part of the ExampleModel and ...
Tamás Tárnok's user avatar
6 votes
Accepted

How to pass rendering parameters for a static controller rendering

The naming of the 3rd parameter of @Html.Sitecore().ControllerRendering method is a bit unfortunate. It's called parameters, while in my opinion it should be called properties. The reason for that ...
Marek Musielak's user avatar
  • 23.9k
6 votes

Sitecore support for async controller renderings

Async controller rendering is not supported . Starting with Sitecore 8.2 async Mvc controllers is supported. As of 8.2 we support async MVC controllers (directly routed). But async is still not ...
Vlad Iobagiu's user avatar
  • 18.6k
5 votes
Accepted

What is purpose of the Controllers folder in Layouts?

I think it's just another way of creating Controller rendering, You basically create Controller item (Of template /sitecore/templates/System/Layout/Controller) and enter the Controller Name (...
Ahmed Okour's user avatar
  • 2,124
4 votes

Sitecore 8.1 Controller Rendering Error

There are a couple of potential issues here: Set the controller name to the fully qualified class name, e.g MyProject.Controllers.SomeController, MyProject Make sure the action name does not have the ...
Richard Seal's user avatar
  • 20.5k
4 votes

Passing an Item ID to the Controller via the Querystring

Your issue is that "{" and "}" are not valid characters in a URL. As such they have automatically been URL encoded when used in your query string. Your options are Strip the brackets before ...
James Walford's user avatar
3 votes
Accepted

Sitecore 9 Platform Essentials Module 7 - Error Rendering Controller: Related Events when using an Edit Frame

Thanks for the very detailed question! Based on your description for how you created the Edit Frame Buttons and how you are referencing them, I suspect that the path the buttons is incorrect. ...
Derek Hunziker's user avatar
3 votes

IOC (Simple Injector) with EntityService

While @dnstommy is correct, what you are doing is not best practice and you really should refactor if you can to use a pipeline approach. The answer to your question is in this line: container....
Richard Seal's user avatar
  • 20.5k
3 votes

Passing an Item ID to the Controller via the Querystring

Encoding of special characters in the URL is default behavior. To have item id without special characters, you can use Sitecore.Data.ID.ToShortID() method to have short id which will not have any ...
Vinayak Chauhan's user avatar
2 votes
Accepted

Base Controller in Habitat

The right place from my point of view to implement BaseController is in Foundation Layer. In this way all features project can inherit from it. In our solution we have a project "*.Foundation....
Vlad Iobagiu's user avatar
  • 18.6k
2 votes

Passing an Item ID to the Controller via the Querystring

You will need to replace the encoded value. From the Id %7BB416980B-40A7-4C8F-8F98-375DD1CD9544%7D you are passing, you will replace %7B with { %7D with } Then you will have the Id as {B416980B-...
Hishaam Namooya's user avatar
2 votes
Accepted

OutputCache with a Sitecore controller

This is most likely down to the DisableBrowserCaching setting in Sitecore. When set to true this setting issues no-cache headers which leaves Sitecore to optionally handle the caching of the page via ...
sitecorium's user avatar
2 votes

Any Best way to call the MVC action method from Hyperlink

You can create your own custom route pipeline in sitecore and map to route the url link like below public class YourCustomRouteName { public virtual void Process(PipelineArgs args) { ...
D S's user avatar
  • 264
2 votes
Accepted

FieldRenderer.Render for controller Rendering not "working"

It seems that I was using the wrong Context Item when I use this RenderingContext.Current.Rendering.Item everything is working fine. Would be nice to know what is the difference between these two ...
squadwuschel's user avatar
  • 1,165
2 votes

Debugging in VS

If you are connecting to a remote instance. Ensure the msvsmon.exe the remote debugging service is running. Ensure the ports are accessible through firewall. Ensure your user has access to remote ...
Bala's user avatar
  • 320
1 vote
Accepted

Html.Sitecore().Rendering() causes: Attempt to retrieve context object of type 'System.Web.Mvc.ViewContext' from empty stack

From the exception it looks like it's ViewContext missing. I'm not sure why it happens in your scenario but to fix this you can try the following code: @using (Sitecore.Mvc.Common.ContextService....
Marek Musielak's user avatar
  • 23.9k
1 vote
Accepted

Lost All Layout After MVC Form Postback to Controller Rendering

Search can be implemented with ajax call without causing redirection to the another page. here you can find the example code - <script> // Function to make the AJAX call and handle response ...
Nilay Patel's user avatar
1 vote

Lost All Layout After MVC Form Postback to Controller Rendering

I have implemented this functionality before. To achieve this functionality I have used Vue.js. You can choose whatever Javascript framework you want to use. The benefit of using Vue.js or any other ...
Swati Gupta's user avatar
  • 3,185
1 vote
Accepted

Where to find the Controller Folder(Source File)

If you want to create a controller rendering then there is an option to clone an existing component in Sitecore SXA. Follow this article to know how to clone a component in SXA. https://sbhatiablogs....
Sumit Bhatia's user avatar
  • 5,133
1 vote

Loading of new page blocked by api call

It looks like a problem with session state behavior. I have faced similar issue in Sitecore 8, when API calls from frontend came to queue and block one another. It was fixed by adding [...
x3mxray's user avatar
  • 3,150
1 vote

Sitecore 8.1 Controller Rendering Error

You shouldn't need the / before the action name in your rendering. Change /Index to Index and it should work properly.
Dan Sinclair's user avatar
  • 5,394
1 vote

Sitecore support for async controller renderings

You can not use async pattern in Sitecore as it does not support it. If you will try to make it work, you will get exceptions or it will work synchronously. There is a very good article from kamsar on ...
Ghan's user avatar
  • 667
1 vote

I need to integrate a controller from a compiled dll into a controller I can build/control. How can I call that as a rendering?

If I'm understanding correctly, you're looking to get the result from a controller, and return that through an API controller. The problem with that is that a controller action generally returns an ...
Matthew FitzGerald-Chamberlain's user avatar
1 vote

IOC (Simple Injector) with EntityService

It's not Sitecore best practice to modify the global.ascx file. In 8.2 global.ascx has been moved private so you no longer allowed to modify the global.ascx anymore. You should build it all and ...
Chris Auer's user avatar
  • 13.1k
1 vote

Custom controller being overwritten by IoC

For anyone coming across this here is what I did. If you have a DI configured it resets any routes registered after you've added them so you need to register them in the initialize Pipeline like so: ...
Adam Seabridge's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible