Questions tagged [display-templates]

Display template is a html template which can be repeat for each item in its model and it will load in specific section of a view of asp.net web application. A template can have styles/scripts or Razor codes in itself also.

102 questions
0
votes
1 answer

MVC DisplayTemplate Not Rendering if Named for Interface

I have a Model: public class Dog: IPet { // IPet Implementation public string Name { get; set; } } and a DisplayTemplate in DisplayTemplates/Dog.cshtml @model IPet // note this is the interface, not the concrete…
Scott Baker
  • 10,013
  • 17
  • 56
  • 102
0
votes
2 answers

what would I use in this situation(asp.net mvc 3 display templates)

I have something like this public class ViewModel1 { // some properties here public List ViewModel2 {get; set;} } public class ViewModel2 { public string A {get; set;} public string B {get; set;} } // view …
chobo2
  • 83,322
  • 195
  • 530
  • 832
0
votes
2 answers

How an i make an ASP.NET MVC3 DisplayTemplate which displays the contents of a Collection?

I'm trying to display the contents of a collection, in my View .. but using a DisplayTemplate to handle the definition of the view, for that specialized property/object. eg.
Foos
Pure.Krome
  • 84,693
  • 113
  • 396
  • 647
0
votes
1 answer

Debugging DisplayFor Helper

I am trying to debug my DisplayFor(model => model.dateOfEmp) initally DateTime would display Date + time. To avoid this I added a display template with a ShortDate. After I added a custom shortdateDisplayFor in the folder DisplayTemplate, it…
aggie
  • 798
  • 2
  • 8
  • 23
0
votes
2 answers

Sharepoint Display Templates How to use Group Display Template

the code in the control display template uses _#= ctx.RenderGroups(ctx) =#_ and there is another JS file named group_content.js that is being called, how do i split my data into groups in order to render some HTML per group?
bresleveloper
  • 5,940
  • 3
  • 33
  • 47
0
votes
0 answers

MVC DisplayTemplate for Lookup list

I am calling a partial view on which I want to collapse a few dropdown controls(previously created by using DropDownListFor). Because the controls are readonly, I just need to show the selected value on each control. I have created a list called…
user938455
  • 89
  • 11
0
votes
0 answers

MVCSiteMapProvider - MVCSiteMap().Menu won't use display template

I have an MVC 4 project which uses MVC Site map provider for it's menu. The project has some customised (in terms of CSS classes) templates such as ~\Shared\DisplayTemplates\MenuHelperModel.cshtml which according to the docs are the right locations…
dougajmcdonald
  • 19,231
  • 12
  • 56
  • 89
0
votes
1 answer

How to extract only month, day and year portion of datetime from DateTime string?

I'm writing DateTime Formatter in ASP.NET MVC and need to format the datetime based on cultural info. My model's property binds DateTime.Now volue to the view and as a result the view is displaying 3/21/2017 9:38:37 AM as a datetime. I'm looking for…
gene
  • 2,098
  • 7
  • 40
  • 98
0
votes
1 answer

Multiple SharePoint display templates with paging results the other one without click functionality

I have multiple search display templates in SharePoint on the same page. If one of them have paging enabled (requirment) the other(s) lose their click events on new page rendered by clicking on 'next page'. I have tried different solutions and the…
0
votes
3 answers

Display for template for an empty list

I have a view with a model, this model contains a list of items.

@Resources.StatusMessage

@for (int i = 0; i <…
Axel Bouttelgier
  • 173
  • 1
  • 12
0
votes
1 answer

Display template for content search webpart issue for datatable and Tabs

I have developed display template and using it in Content search web part. For displaying result on page i am using JQuery datatable/JQuery Tabs in display template. Everything works fine, but sometime while loading page i am getting error like…
Milan Jain
  • 21
  • 3
0
votes
1 answer

Display a sharepoint list row in a table with JS

I have a sharpoint list with one row containing project info. projectnumber ProjectName ProjectAdmin Contracter and so on. I want to display this as a nice table in the teamsite. I reckon this is done with a display template or Javascript. I tryed…
0
votes
1 answer

SharePoint - Display Templates - Getting Every Item in All Lists in Site

I'm trying to get every single item from all lists within a SharePoint site. All of the docs and answered questions I've found in order to do this usually explain how to get all lists or all items from one list, but not every item in all lists…
LaLaLottie
  • 393
  • 1
  • 4
  • 17
0
votes
1 answer

Currentitem undefined in new function ( Deffered)

I am editing a item display template in sharepoint. the following problem occurs: ctx(clientcontext).currentitem becomes undefined in a custom function. how can i solve this. Here is a litle code snippet: var p = getFollowers(); console.log("") …
0
votes
2 answers

@for loop iterating through json in MVC 4

(edited)Now I have fixed the previous error but getting the error: Illegal characters in path. I'm trying to iterate through some json building an unordered list of links. I have the @for statement in a display template and the Html.DisplayFor in…
Jeff Mcbride
  • 453
  • 2
  • 6
  • 19