Questions tagged [view-templates]

25 questions
56
votes
5 answers

Correct, idiomatic way to use custom editor templates with IEnumerable models in ASP.NET MVC

This question is a follow-up for Why is my DisplayFor not looping through my IEnumerable? A quick refresh. When: the model has a property of type IEnumerable you pass this property to Html.EditorFor() using the overload that only…
GSerg
  • 76,472
  • 17
  • 159
  • 346
7
votes
3 answers

Render partial view on the server or send json data and render template on the client

I was wondering what would be a good approach (or recommended approach) to render partial views in a web application. I have a requirement where I need to load data into an already rendered page using AJAX, sort of like a "Load more..." link at the…
omarello
  • 2,683
  • 1
  • 23
  • 23
4
votes
4 answers

When do you use <% -%> instead of <% %>

I've noticed that in some lines of rails views, this is used: <% # Code... -%> instead of: <% # Code... %> What is the difference?
HB.
  • 111
  • 1
  • 3
3
votes
2 answers

Angular 7, Enum and Input property binding

The issue is when binding an enum with a view template using @Input, the enum is being resolved to undefined. The component: enum FormAction { Insert, Update } @Component({ selector: 'app-member-editor', }) export class…
M. Ko
  • 563
  • 6
  • 31
3
votes
5 answers

TYPO3 pass Fluid variable value to the Javascript

In a fluid template I have a fluid variable which value I would like to use in my JavaScript code. I am using JavaScript inside of fluid template. My Code:
Denis Milosavljevic
  • 365
  • 4
  • 8
  • 17
3
votes
1 answer

Creating ASP MVC custom views with automatic ng-bind

I am thinking of doing the bind coding task on the server side. Let me describe. In ASP MVC i was making a viewmodel for each page then by taking help of @Html.EditorFor and others, I was making the view part. Now i want to make a logical relation…
3
votes
1 answer

Overriding orchard view template

I want to customize/change html/css of the login page (~/Modules/Orchard.Users/Views/LogOn.cshtml). I created a cshtml file under the themes folder (Themes - MyCustomTheme - Views - LogOn.cshtml) with the same name. This didn't work. How can I…
user471317
  • 1,231
  • 2
  • 22
  • 35
2
votes
1 answer

UIHint not using EditorTemplate

I have a model like this: public class MyModel { [ScaffoldColumn(false)] public int CharityId { get; set; } [UIHint("Charities")] public SelectList Charities { get; set; } } Then I have an EditorTemplate called…
Erik Funkenbusch
  • 92,674
  • 28
  • 195
  • 291
2
votes
0 answers

On different errors set different view files in Zend Framework

I have dispatch error listener and there I get thrown exception and check if it is instance of CustomeException. In that case I want to set custom view template with default layout. public function attach(EventManagerInterface $events, $priority =…
2
votes
0 answers

ASP.NET MVC - performance issue when using EditorFor

I have an MVC3 page that renders a view containing a table. The table has a column for each day of the month, and there are 7 rows, each representing a department of an organisation. In each cell of the table, there is an input textbox, where the…
SLP
  • 311
  • 3
  • 11
2
votes
1 answer

Make Rails look for .mobile files in subdirectory?

I'm using the mobile fu gem to do some user-agent detection, so that I can serve either .html or .mobile extension templates depending on the client, Now, this part works really good, but I don't like that view folders become a bit cluttered with…
1
vote
0 answers

When to use block or include in pug?

I have an issue understanding when to use extends with block rather than include in pug templates. Are these two ways of building partials mostly interchangeable or is there a reason why you would use one way rather than the other?
ilovebigmacs
  • 983
  • 16
  • 28
1
vote
0 answers

Version control for MySQL objects (panoramic templates)

I am building a multi-tenant system that uses the wonderful panoramic gem to store HAML view templates in a MySQL table. I often edit these templates (body, text) and would like some kind of version control system so that I can diff, rollback, view…
Peter Bloom
  • 1,302
  • 14
  • 21
1
vote
1 answer

How to generate edit modals for each element in the model?

I'm trying to use thymeleaf to generate edit and delete modals for each element in the model in my ModelAndView using th:each. The modals are indeed created and have unique ids based on the id field of the elements. The problem I have is none of the…
ChiefTwoPencils
  • 13,548
  • 8
  • 49
  • 75
1
vote
1 answer

Trying to AJAXify this rails 4 method call and getting 500 error

I have a table in my view: views/uploads/index.html.erb other code
blah blah blah …
banditKing
  • 9,405
  • 28
  • 100
  • 157
1
2
File nameActions