Questions tagged [controller]

For questions specifically related to the use of MVC controllers with Sitecore. This tag should not be used for general .NET MVC controller questions.

7 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
38 views

How to make two controller renderings working on same page to preserve tracking?

I have AccountsController in my solution with two methods ExportData and DeleteAccount. I have created two separate Controller Renderings with similar code: @using System.Web.Mvc @using System.Web....
1
vote
0answers
108 views

Getting SitecoreControllers Working With Swagger

Is there a good way to get Swagger to work with controllers that inherit SitecoreController? I've checked this blog out which uses controllers that inherit from ApiController. I thought I could get ...
1
vote
0answers
87 views

Keep Sitecore Context Based On Page When Posting Back

I have a module that uses ajax to post back to the server for data. Some of this data is configurable while in experience editor. Users are winding up in a state with this module where experience ...
0
votes
0answers
40 views

Can we create multiple ActionResults in Sitecore SXA custom controller rendering?

Per Sitecore SXA documentation, in SXA custom controller, we have to override the GetModel() method and we call repository to get the model. I would like to create multiple Action Results in Sitecore ...
0
votes
1answer
100 views

Loading of new page blocked by api call

I have a website with two pages (A and B). Both have some content which is loaded via renderings. A has a button which opens B in a new tab. A also has some frontend code which calls one of my APIs, ...
0
votes
1answer
129 views

Sitecore 9.2 custom route api/<controller> is throwing null error

I have a requirement, When clicking the close I need to destroy the user session. For this, I have created an ajax call to destroy the session. For calling controller with the Sitecore context, I ...
0
votes
0answers
123 views

Returning a file stream from a Controller

I have pdf files in folder, I want user enable to download file, in MVC controller its quite simple as below return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, filename); but ...