Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
2 answers
53 views

Getting error after login

I have restored master db from prod to local. Updated the connection string, but after I login, I see the below error. I have tried comparing my local's file with vanilla and even the one in prod. ...
Bhawna Jain's user avatar
0 votes
2 answers
56 views

Custom MVC Routing in Sitecore does not read Sitecore context language

I am trying to create custom routing for multiple languages. Created processor like below image. Problem is that it does not give exact context language but gives "en" as language name. Can ...
Rashmi Ranjan's user avatar
1 vote
1 answer
34 views

How to replace a link break (&#xa) with a comma using Regex

One of our clients have asked us to replace the first line break (&#xa) with a comma. So far the regex that we have for our location address is this: Location = vacancy.Location.IsNullOrEmpty()...
user13705's user avatar
1 vote
1 answer
381 views

What is missing in my setup of a Custom Error Handler in Sitecore 10

I was tasked with trying to set up a simple static cshtml page that would avoid the yellow screen sent by the .net framework. I built a class library that has a controller and a view. controller: ...
Paul T. Rykiel's user avatar
1 vote
1 answer
56 views

How to support glass model properties in MVC form validation

I am attempting to build an MVC form that uses ajax to post to a controller action which will return one of 2 partial views depending on the model state, and then perform a partial page update via ...
David Buckell's user avatar
1 vote
2 answers
606 views

Zip file download File response not working in Sitecore MVC

Zip file download File type response not working in Sitecore MVC. Requirement: User can download each file on click download button and download selected files or download all. So selected files or ...
Prem Murmu's user avatar
0 votes
0 answers
104 views

Encrypt connection string credentials from Web.config to ConnectionStrings.config

I need to move secret credential values from Web.config to ConnectionStrings.config in baseline folder, how can I do that?
sitecorelocal123's user avatar
0 votes
2 answers
180 views

Call Action Method in all pages using Pipelines?

Is it possible to use Pipelines and call specific action method in every page? Im trying to build a Modal Popup based on User IP it will redirected user to user-specific country. But this Action ...
Suman Baul's user avatar
0 votes
1 answer
122 views

How to use OData API key with custom integrated API .NET 4.8 MVC controller?

https://doc.sitecore.com/xp/en/developers/91/sitecore-experience-manager/api-keys-for-the-odata-item-service.html https://www.linkedin.com/pulse/sitecore-api-key-throttle-series-2-md-arifuzzaman-arif/ ...
Mohamed Abbas's user avatar
1 vote
1 answer
464 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 ...
w00ngy's user avatar
  • 155
1 vote
1 answer
607 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 ...
Suman Baul's user avatar
0 votes
0 answers
90 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 files sitecore.kernel.dll, sitecore.client.dll, system.web.mvc and deleted ...
Vinaya's user avatar
  • 1
0 votes
1 answer
572 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 that needs to ...
Flo's user avatar
  • 45
0 votes
1 answer
850 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\...
Sophie's user avatar
  • 31
2 votes
1 answer
82 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 ...
Mittal's user avatar
  • 61
2 votes
1 answer
149 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....
qkhanhpro's user avatar
  • 177
1 vote
0 answers
59 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 ...
Pranav Bilurkar's user avatar
2 votes
2 answers
9k 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 ...
Shelley Benhoff's user avatar
1 vote
0 answers
824 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 =...
sukesh's user avatar
  • 3,162
1 vote
1 answer
908 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 ...
Adam Seabridge's user avatar
1 vote
1 answer
101 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 ...
Arik Torhn's user avatar
0 votes
0 answers
29 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 ...
grandeale83's user avatar
3 votes
1 answer
449 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 ...
Rolan Christofferson's user avatar
1 vote
1 answer
293 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 ...
grandeale83's user avatar
0 votes
2 answers
2k 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() { /...
user avatar
1 vote
1 answer
235 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 ...
jdylanmc's user avatar
  • 1,492
0 votes
0 answers
264 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: ...
Levi Wallach's user avatar
  • 1,085
3 votes
1 answer
354 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?
Andi AR's user avatar
  • 763
0 votes
2 answers
312 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
vinodshetty's user avatar
4 votes
1 answer
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,...
Durga Prasad's user avatar
1 vote
1 answer
153 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 ...
Levi Wallach's user avatar
  • 1,085
0 votes
1 answer
1k 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 ...
PVM's user avatar
  • 963
0 votes
2 answers
4k 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 ...
Levi Wallach's user avatar
  • 1,085
3 votes
1 answer
4k 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 ...
Levi Wallach's user avatar
  • 1,085
-1 votes
2 answers
1k 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 ...
Bryn Thompson's user avatar
1 vote
2 answers
4k 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 ...
Hos's user avatar
  • 884
0 votes
1 answer
369 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. ...
Renuka's user avatar
  • 185
1 vote
1 answer
631 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 ...
jdylanmc's user avatar
  • 1,492
0 votes
1 answer
1k 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-...
Jen's user avatar
  • 1,393
1 vote
1 answer
777 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 ...
Corey Burnett's user avatar
0 votes
2 answers
2k 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] ...
PSS's user avatar
  • 607
1 vote
2 answers
2k views

Checking if a general link is empty within a partial view

I can display a link from a field but I only want to display the link if it's been filled out by the user. I tried surrounding by a conditional statement and checking for the field being null, but ...
Levi Wallach's user avatar
  • 1,085
1 vote
2 answers
5k 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 ...
Po Po's user avatar
  • 111
0 votes
1 answer
466 views

Sitecore SXA action call a controller action

how to create a button in Sitecore SXA which would call a controller action or a rest Api ? would it be through javascript or is there an ootb feature in SXA , where i could get the user and item ...
SitecoreNoob's user avatar
1 vote
2 answers
367 views

Is creating a Model under /sitecore/layout/Models a best pratice?

I was wondering if there was something more modern than having to create a Model item under /sitecore/layout/Models for every view rendering I have. If I'm informing the view the namespace and type I ...
Hugo Santos's user avatar
  • 2,311
2 votes
2 answers
3k views

How to retrieve image url in MVC view from model

I am new to Sitecore. I am trying to create a small demo which will display all the products with its image and description. But i am getting error in my view also i am not able to display anything. ...
sheela singh's user avatar
1 vote
2 answers
2k views

Response.Redirect in Mvc.requestbegin processor does not end response

Im doing below in mvc.requestbegin processor if (!IdentityChecker.IsUserIdentityValid(args.RequestContext.HttpContext.Request.RequestContext.HttpContext.Request) && !args.RequestContext....
nari447's user avatar
  • 407
1 vote
1 answer
408 views

How can I integrate/embed MVC app into the Sitecore desktop?

I've got a third party MVC app that I would like to integrate into the Sitecore 7.2 desktop so that users logging into Sitecore can use it. I've seen the answers for using compiled DLLs as renderings ...
hofo's user avatar
  • 215
0 votes
2 answers
7k views

How do I access Sitecore.Context.Item in normal MVC Controller

I have a normal MVC Controller (not a Sitecore Rendering) which I am calling in an AJAX request (from a Sitecore page). I need the current Sitecore item there. How can I access it there?
user3621's user avatar
  • 414
1 vote
3 answers
2k 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 ...
Ken McAndrew's user avatar
  • 5,102