Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mvc]

For questions relating to ASP.NET MVC implementations.

0
votes
1answer
33 views

MVC Form behaves differently

I'm using the below code snippet. It's working fine in two environments but in the second environment it's appending action url Url="api/sitecore/controllername/ActionName". cshtml: @using (Html....
1
vote
1answer
65 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....
1
vote
1answer
32 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 ...
0
votes
2answers
59 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?
1
vote
1answer
40 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 ...
1
vote
1answer
35 views

Requested document not found when using MVC routes

I am getting 404s (requested document not found) when I try to use a custom route I created per the guide here: https://kb.sitecore.net/articles/700677. My patch config is showing up in showconfig, ...
2
votes
1answer
56 views

Get MultilistField selected items

I am working on a view rendering and trying to get a list of selected items from a multilist field. I don't know if it matters, but the list field I am trying to get the selected items from is a ...
5
votes
1answer
88 views

How can I append HTML within and before the text of a rendered Link Field?

I have a General Link field in Sitecore that I would like to append some HTML to. I know that I can create a custom extension method and put what I want after the link's text by doing the following: ...
3
votes
0answers
180 views

Image and link fields rendering as raw values

I'm using Sitecore 8.2 and attempting to render Image and General Link fields as recommended in this post: @model Company.Feature.Foo.Models.FooBarViewModel ... @Html.Sitecore().Field("{123e4567-e89b-...
1
vote
1answer
75 views

How to render a web form Sublayout in MVC layout?

I am trying to render an Ascx page from an MVC View Rendering in Sitecore. For example, in old Web Forms / Ascx to put placeholders you'd use <sc:Placeholder runat="server" key="placeholder-key" /&...
0
votes
0answers
50 views

Best way to incorporate new field into existing class?

This is a noob question, my apologies, but I am a noob. We want to add a dynamic persons list (staff authors) to an existing WeBlog 3.1 component in our Sitecore site, but are running into an error ...
0
votes
1answer
48 views

Third Party custom controls for Sitecore

Does anyone know of a suite of third-party custom controls that are available for purchase for Sitecore? Or are you just using the standard VS third-party tools? We are going to start rewriting our ...
0
votes
1answer
95 views

Sitecore 7.2 using droplink

I will start out by saying I am a bit of a noob when it comes to C# and Sitecore, but I am getting better. I am trying to update our code to use a droplink control for an event item (we'll call it ...
1
vote
4answers
116 views

Sitecore custom log file is empty

Please help me what am missing in writing log for the exception. Always am getting an empty file Logger in Sitecore.Config <?xml version="1.0" encoding="UTF-8"?> <log4net> <...
5
votes
0answers
152 views

Sitecore 8.2 MVC site setup and Issues

I am creating a Sitecore 8.2 MVC test website and I am getting couple of errors and client form validation Issue. Get methods are working fine but post method is not working. I have exact same test ...
6
votes
1answer
54 views

Is WFFM with MVC supported in Sitecore 7.1?

We are on Sitecore 7.1 (rev. 140324) and need to use WFFM with MVC. Therefore I would like to check if Sitecore 7.1 (rev. 140324) supports WFFM with MVC.
1
vote
1answer
92 views

The type or namespace 'code' could not be found

In my Helix based solution, every time I publish a change to a feature project and load the site I get this error below. The error goes away when I publish the website project in the project layer. ...
5
votes
2answers
164 views

Is it possible to have several campaign personalisation for the same component?

I need to develop a specific feature that allows me to personalize a component "banner" of a page based on campaigns.(so basically this is based on querystrings in url) Here is my configuration: For ...
8
votes
1answer
151 views

Upgrade path from Integrated Dynamic Placeholders to Sitecore 9 Dynamic Placeholders (OOTB)

Does anyone have a SPE script that could be used to upgrade the rendering parameters of existing content to the new dynamic placeholder style required for Sitecore 9 Dynamic placeholders? We used to ...
1
vote
1answer
252 views

Rendering a Sitecore field in MVC with an enclosing tag and class

We effectively have an item with three fields. Text to display in a heading. Droplink with the type of heading to display the text in (h1, h2, ...). Droplink with the heading style that points to the ...
2
votes
1answer
150 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 ...
0
votes
1answer
105 views

Is it possible to display field name in View(cshtml) using glass mapper

I am trying to display field name using Glass Mapper in view rendering in following format: FieldName - FieldValue FieldName - FieldValue Ex: Country - USA City - New York I ...
0
votes
0answers
152 views

A public action method 'GetModal' was not found on controller Controllers.ProfileUpdate.PrivacyConsentController'

This is a bit of a weird case. When the user is not authenticated, I can hit the action method GetModal however once authenticated the code can hit the constructor for PrivacyConsentController but can'...
5
votes
1answer
184 views

Force controller rendering in head of page to render after other renderings

I know that MVC and by definition Sitecore MVC renders components from top to bottom order, but is there any way to force (hack) a controller rendering (which is used in the head of the page) to be ...
0
votes
0answers
24 views

How to display image in sitecore [duplicate]

How to render a responsive image in the Sitecore? I have an image of size 1200 px have to display the image in thumbnail size.is it possible to do it in Sitecore? Any example or sample is much ...
0
votes
0answers
107 views

Custom form verification does not show custom error message

I need to validate a custom control on a custom form verification action in WFFM, Sitecore 8.2 update 5. I set custom error message on the form verification, and I changed the hide inner exception ...
0
votes
0answers
219 views

Powershell Script to select Dropdown value

I am trying to run power shell script to select droplink value.With my script instead of selecting value the id is added to the droplink.please help me out what am missing? code: if ($Property){ ...
5
votes
1answer
143 views

Pre-populate form fields in WFFM

I have a requirement to pre-populate fields from an external source. Is there a way to hook into a pipeline to achieve this? I'm thinking something similar to how Sitecore can populate the fields by ...
0
votes
2answers
79 views

Powershell Script error

I am trying to import csv file to content data via power shell script.am getting following error message New-UsingBlock : Item '/sitecore/content/Web3/Content Shared Folder/Property Page' is ...
6
votes
2answers
398 views

How do you programmatically get the HTML from a Sitecore item, including all its renderings?

I'm trying to programmatically get the HTML from an item, including its presentation details (i.e. placeholder items inserted via Experience Editor). I'm using the top solution from this post but it ...
2
votes
0answers
174 views

Generating JSON-LD structured data for SEO

We are working on an MVC web site where we are following the principles of atomic design, with heavy use of placeholders (including dynamic) and very granular renderings. This site's pages are heavily ...
0
votes
1answer
211 views

Sitecore Edit Frame issue

I am having issues when passing Guid as the data source for edit Frame. When I populate the Guid directly it works fine but while binding it from model am getting an error message Code: @using ...
0
votes
1answer
374 views

Programatically render nested renderings/placeholders from an item [duplicate]

I am working on programatically rendering an item to html in code. I found this question https://sitecore.stackexchange.com/a/6256/1133 which almost serves the purpose of my request, except it isn't ...
0
votes
0answers
315 views

After upgrade, getting “The object has not yet been initialized. Ensure that HttpConfiguration.EnsureInitialized() is called”

After completing the upgrade from Sitecore 8.1 Update 3 to Sitecore 8.2 Update 6 on accessing the launchpad, getting the below error. "Message":"An error has occurred.", "ExceptionMessage":"...
0
votes
3answers
407 views

Passing an Item ID to the Controller via the Querystring

I am having an issue when passing itemid as query string to controller url is rendered like this http://sitecorelocal/api/sitecore/Product?sc_itemid=%7BB416980B-40A7-4C8F-8F98-375DD1CD9544%7 ...
0
votes
1answer
243 views

Custom Controller Action to Anchor tag [closed]

Any ideas on how to determine the route of the controller from Anchor Tag? For Example: Question 1: When Product Name link in screen 1 is clicked.The product details from the controller have to be ...
1
vote
1answer
243 views

How to pass values from the rendering parameters in custom sxa rendeing variants component

I'm creating a custom component in sxa with rendering variants. I had a look at many examples where most of them are using the field name that's available in the page item. <div @Html.Sxa()....
0
votes
1answer
268 views

The model item passed into the dictionary is of type 'Sitecore.Mvc.Presentation.RenderingModel' but this dictionary requires a model item of type

While accessing the link on website got the below error. Description: An unhandled exception occurred. Exception Details: System.InvalidOperationException: The model item passed into the ...
4
votes
1answer
937 views

@Html.Sitecore.Field is not rendering any values

In this code model, fields are returning value but when I try to render using @Html.Sitecore().Field its returning null.For experience editor, these fields should be editable.How to do it? Am new to ...
0
votes
0answers
63 views

How can alias resolution issues for a site be debugged?

I am working on an MVC app deployed on Sitecore 8.2. Sitecore is setup to handle multiple sites. In the development environment, we have an integration instance of Sitecore deployed to a server. Each ...
2
votes
4answers
380 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: ...
3
votes
1answer
221 views

How does redirecting from within an MVC.RequestBeginProcessor differ from Web Forms?

I am porting some code from Web Forms to MVC. In order to handle a case where query string parameters on the URL can change the landing page, I have added a RequestBeginProcessor to the mvc....
0
votes
1answer
171 views

Handling 2 separate forms in one View and Controller

Need some ideas for the following problem: My View called MyView (code adjusted to post): if(condition== A) @using (Html.BeginForm()) { @Html.Sitecore()....
0
votes
1answer
363 views

Placeholders defined in MVC /Views/layout.cshtml vs. placeholders defined from templates => __standard_values => Presentation details

Since we have our Templates => __Standard Values => Presentation => Detail => Layout Details pointing to Visual Studio MVC /Views/Shared/_Layout.cshtml, and this Layout already defines the ...
1
vote
0answers
71 views

Sitecore 8.2 MVC developer level documentation [closed]

What are some good sources for Sitecore 8.2 MVC developer level documentation? The documentation available on the Sitecore site doesn't seem to have much detail: https://doc.sitecore.net/...
1
vote
1answer
201 views

Handling query strings from external sources

With Sitecore 8.2 MVC, what is the best way to intercept query string parameters from external sources site wide? For example, another site will link into our Sitecore site with a URL that may ...
2
votes
1answer
217 views

What is purpose of the Controllers folder in Layouts?

I've noticed that in /sitecore/layout there is a Controllers folder (first item underneath actually). In that folder you can add items of type Controller. These items have fields for a controller name ...
4
votes
2answers
287 views

Sitecore MVC Custom forms with radio group buttons

I am new to Sitecore 8 and I need to create a page that collects data input from a user, the page has different radio groups such as: Then, Select the toppings which are five choices. In a ASP.NET ...
5
votes
1answer
262 views

Posting a single form with multiple buttons in a Sitecore page. Is it possible?

Anyone know if it is possible to post a single form with multiple buttons and each button post to a different controller action in Sitecore? On my scenario I have a controller which has 3 actions: 1- ...
6
votes
1answer
685 views

Postback Does Not Return Full Page Layout

Sitecore Version: 8.2 (rev 170614) Glass.Mapper Version: 4.4.0.199 .NET Framework Version: 4.6 I have a Controller Rendering that represents "Redemption" form on my site that can be added ...