Questions tagged [mvc]

For questions relating to ASP.NET MVC implementations. The ASP.NET MVC is a web application framework developed by Microsoft, which implements the model–view–controller pattern.

Filter by
Sorted by
Tagged with
0
votes
0answers
95 views

Sitecore 10 MVC Multisite Container Architecture?

Problem There is lots of documentation on how to create an MVC Sitecore site with Docker and containers. But how would you recommend creating a multisite Sitecore site for a multitenant 8+ site ...
1
vote
3answers
953 views

Accessing IMvcContext/ISitecoreService in a view rendering

This is using Sitecore 9.0.2 and Glass 5.1.10. I'm trying to figure out the best way to access the IMvcContext (or ISitecoreService) in a view rendering. Using controller rendering is very ...
0
votes
1answer
262 views

View Rendering Error

I am new to sitecore. I am stuck in one issue. While browsing to a new sitecore item created like http://sc92/newpage I am getting the below error. Error Rendering View: \Views\Layouts\Website\...
1
vote
3answers
343 views

The method 'Concat' is not supported. Declaring type: System.Linq.Queryable

I have two IQueryables that i need to merge. This is my code: such that all results having region name "UK" will appear on top while all results having region other than UK will appear after search ...
1
vote
1answer
126 views

Redirect to a Sitecore Item or Page with ViewModel?

I want to pass a ViewModel to a Sitecore Page from a Controller Action. So far this below post Link has helped, but I'm not able to pass a model to the page. I'm calling the controller from a Form ...
0
votes
0answers
14 views

Is it possible to add a custom field for a sxa cloned rendering component in sitecore 9.0.1

I am using sxa 1.7 and sitecore 9.0.1 ,have cloned a event listing rendering and i want to add a custom field for it without touching the code. Is it possible to do that. If yes please explain how? ...
0
votes
0answers
29 views

How to retrieve a rendering varient field values in sitecore 9.0.1 using sxa 1.7

I am creating a custom search result component, but at the end i m able to retrieve rendering varient fields name not the values .How to retrieve rendering varient field values which is linked to a ...
2
votes
2answers
4k views

The type or namespace 'AspNetCore' does not exist in the namespace 'Microsoft' - fix causes intellisense errors for all view renderings

I have a project on Sitecore 9.3 that uses both View and Controller renderings. My view renderings have not had any intellisense errors so far and work just fine after being built. When I built my ...
13
votes
2answers
9k views

why is my Richtext field not rendering as rich text?

this is the value on my Rich text field: <p><strong>Did you know the monarch population has declined by more than 90 percent?</strong> Did you know that much of the monarch summer ...
23
votes
2answers
6k views

How do I implement Accelerated Mobile Pages (AMP) with Sitecore?

This is just a general question. Has anyone implemented AMP with Sitecore before? Is it possible, how difficult and could you point me in the direction of documentation?
0
votes
0answers
52 views

Compilation Error after integrating VS2017 and Sitecore 9.3

I am newbie to 9.3, Installed and browsed the sitecore project. Tried to integrate with Visual project by adding reference file sitecore.kernel.dll, sitecore.client.dll, system.web.mvc and deleted ...
1
vote
0answers
46 views

How to build Sitecore Application with Visual Studio 2017 with MVC pattern OR HELIX methodology? [closed]

As i am new to sitecore and though i have basic understanding on how to create site through sitecore's content editor and using CMS. Now, i want to create a web application/website using Visual ...
0
votes
1answer
241 views

Accessing Sitecore Context in a normal API

I'm working on a project where I have a controller with a few endpoints which can be called from sitecore and non-sitecore sites. This works fine. Now I have to add a different endpoint which needs to ...
0
votes
2answers
781 views

Calling async method inside action index() method

I want to call async method inside the ActionResult. This is how my code looks like public HomeController : GlassController { public override Task<ActionResult> Index() { /...
1
vote
0answers
31 views

Explore mode GeoIP data not available

In Sitecore Experience Editor Explore view I am facing one issue in which I am not getting any country list in GeoIP section under Visitor information. Below is the screenshot of my page. Please ...
2
votes
1answer
82 views

Upgrading from Site core 7.2 to 9 - What would be breaking

We are maintaining one Sitecore 7.2 installation with Lots of ASCX / Web Form Lots of custom code hooked into Sitecore using configuration / patches SOLR Search We plan to migrate these system to 9....
1
vote
0answers
454 views

Ajax forms not working in Sitecore 9.3 [closed]

We have deployed the code files to a fresh 9.3 XP instance and the Ajax form renders differently. View: using (Ajax.BeginRouteForm(MvcSettings.SitecoreRouteName, null, new AjaxOptions { HttpMethod =...
9
votes
3answers
2k views

Disable submit button on MVC form that has slow action

I have a Sitecore 8.1 WFFM form in an MVC form rendering, with a save action that takes a few seconds to complete. After submitting the form, the user just sees the form page they submitted with no ...
1
vote
2answers
2k views

How to render all fields from a datasource containing items with title,image,description fields using controller rendering

Controller: public class RotatorController : SitecoreController { public ActionResult Index() { var dataSourceId = RenderingContext.CurrentOrNull.Rendering.DataSource; var dataSource = ...
1
vote
1answer
313 views

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

We have a web controller inside our Sitecore 8.2 Site that returns a search box view. The controller is exposed as an API endpoint like so: {url}/api/search/large/ When making an http web request to ...
3
votes
1answer
865 views

SXA custom component, Is my component correct?

First of all, I'm sorry for my question because I'm beginner in Sitecore SXA and in English too. ;) I'm working on SXA compatible component and I have already advanced well I think but I must have ...
0
votes
1answer
1k views

Sequential Key Dynamic Placeholder for MVC

I've constructed a dynamic placeholder using the top answer in this post: https://stackoverflow.com/questions/15134720/sitecore-dynamic-placeholders-with-mvc. This implementation uses the GUID of ...
5
votes
1answer
585 views

Code to determine if a specific component is already on page

Issue: I want to add two accordion components to one page. The IDs are the same so both of the components will not work. My Proposed Solution: Using MVC, add code to the component that will check if ...
1
vote
2answers
3k views

Error Rendering View

I am trying to preview a page from Sitecore Rock, from VS but I get this error. I have a Layouts, and I have putted that layouts in _Standard Values of that page. I don't know where is the problem now ...
1
vote
1answer
36 views

MVC Route within content editor

I have a custom tab on the right-hand side(where we can see item fields) for my items in content editor and I am loading a MyTab.cshtml page within this custom tab. This .cshtml I'm trying to post a ...
0
votes
0answers
26 views

Edit frame in a page with synonyms fields [duplicate]

I'm new to experience editor in sitecore. I'm writing an edit frame in razor page using as datasource the page item ID. The edit frame should modify some fields read by a rendering in the page. But ...
3
votes
1answer
193 views

How to apply rendering to child items

Assume I have a menu with menu sections. The menu has a title, opening paragraph, and a list of menu sections. content title - Single line text paragraph - Rich text sections - Multilist ...
1
vote
1answer
174 views

page template and his base template instance items

I have an Item in Sitecore, and I know it's derived from a certain base template. I have that base template ID, but I want to get the instance of this base template that is part of my page. I want it ...
3
votes
1answer
758 views

MVC rendering not being rendered in normal mode

I have a rendering that is on an item, and all its dependencies and templates are published (this has been verified). The rendering itself is inside a dynamic placeholder. It shows up fine in edit ...
5
votes
3answers
6k views

Error with controller rendering - "does not implement IController"

Using Sitecore 8.2 I have multiple MVC projects in a VS Solution. For each project, I remove the RouteConfig.cs, but for one, I forgot and clicked on publish. (I'm not sure if thats the reason for ...
0
votes
1answer
133 views

Rendering Model differences in Sitecore 8.2 vs 9.1

I am upgrading a solution from Sitecore 8.2 to Sitecore 9.1. In Sitecore 8.2, we have a rendering definition item within Sitecore that only has a View file defined. The rendering definition does not ...
0
votes
0answers
84 views

Rendering causing error in experience editor only on some pages?

I have a rendering that displays fine on our CD servers, and in Experience Editor on some pages, but not on one page, where it's throwing an error. When I check the logs I see the following error: ...
4
votes
1answer
2k views

Is it possible to combine Sitecore 9.1+DotNet+React Js

I have a requirement in my project. It is an existing project which is developed in Dotnet MVC + Sitecore 9.1, so some part of the page in that project needs to be implemented in react js, for example,...
3
votes
1answer
285 views

Programmatically add log information in all renderings (controller, view) HTML

Is there an option to write some logging information, like rendering name and data-source location, in every view programmatically, without go and modified in all views?
11
votes
2answers
3k views

Create controller rendering in SXA

As a test, I wanted to create a rendering for an SXA site. It had to be added to the toolbox and have a controller, model, and view. I read this Creating new renderings that are compatible with SXA ...
4
votes
2answers
392 views

Adding Views - VS Adds Scaffolding and NuGets

Can people suggest a good way to add views to a project in Visual Studio? The standard MVC way adds scaffolding (Folders named for controllers) and NuGet packages (MVC, Razor, WebPages, etc...) I'm ...
8
votes
2answers
2k views

Rendering Caches not working

I have a problem with my HTML cache always being empty when I look at the cache report screens in Sitecore I have done the following: Enabled Cacheable and Vary By Data on each rendering in Sitecore (...
0
votes
2answers
122 views

Domain level cookie in Sitecore

I need to set main domain(abc.dis.com) cookie in my sub domain(xyz.dis.com) in sitecore,please suggest. Please find the below code snippet,but it's not working. Thanks in Advance
0
votes
1answer
794 views

Any Best way to call the MVC action method from Hyperlink

Currently, we are having a hyperlink tag and the MVC action method is called directly from hyperlink as <a href="/api/sitecore/{controller Name}/{action Name}"> Hyperlink Text While hovering ...
0
votes
1answer
46 views

Retrieving items from a multiselect Rendering Parameter

I'm trying to retrieve items via a multiselect rendering parameter. It parses the rendering parameter correctly but even though it doesn't throw an error when adding a new item to the model, when it ...
-1
votes
2answers
580 views

Issue sending Base64 encoded image in JSON to Sitecore MVC controller method

I wonder if someone could help or point me in the right direction as a Sitecore novice. I have a Sitecore MVC controller wired up to accept a JSON request. Within this request can be a Base64 encoded ...
0
votes
2answers
3k views

Retrieving url from general link field in rendering parameter

I'm trying to grab the id and/or url attribute of a general link rendering parameter in the view, but I can't seem to make it work. I can't cast it to a Linkfield (it says it can't cast a string to a ...
3
votes
1answer
1k views

retrieving the url from a link field in a view

I'm trying to retrieve just the url attribute of a link field for an item in a view. The view is just using the item as it's model so just retrieving the link field value, which is producing the ...
1
vote
2answers
2k views

How to get Rendering from RenderingReference

We are using Sitecore 9.1 MVC. It is possible to get all rendering references for a given item by using: item.Visualization.GetRenderings(Sitecore.Context.Device, true) However, this will give me ...
0
votes
1answer
282 views

Create multiple Views under one folder and have the different controller resolve the respective Views

Implementation: I am creating my custom SXA components for Header, Footer and Breadcrumb I have a project "Navigation". Under Navigation I have created three controllers Header, Breadcrumb, Footer. ...
1
vote
1answer
442 views

How do you register an MVC Area with Sitecore 9?

I have a pre-existing Sitecore 9 instance that houses an existing website. I have created a new solution, with a new web project, and am attempting to install this project into the existing Sitecore ...
0
votes
1answer
659 views

Can I render a link with title and aria-label attributes using BeginField?

I'm using SXA 1.8 with Sitecore 9.1 For a cloned rendering - in my cshtml I need to conditionally wrap a list item in a link. I have got the link part working, but I can't seem to add title and aria-...
1
vote
1answer
527 views

Is there a way to use the Sitecore MVC Field helpers and render a General Link with stuff appended to the query string?

I have an item with a General Link field named "MyLinkField". In my view I have the following: @Sitecore.Html().Field("MyLinkField") That works great to output the link. Now I have added a ...
0
votes
2answers
1k views

Redirect URL A to URL B

I want to redirect one URL to the another. Suppose, I have 2 URLs www.abc.com/home/gateway [Item for /gateway is not created in sitecore] www.xyz.com/newgateway.php [This is not a Sitecore Webpage] ...
4
votes
5answers
1k views

Cannot find packages containing StandardController

I am very new to Sitecore, trying to implement a basic controller inheriting from StandardController. I've followed the official Sitecore docs for setting up the environment to work with MVC here: ...