Questions tagged as 'razor'

2
answers

Inserting special character in view

I have an HTML table where one of your td needs to enter the following information: <td>@item.OrderSend º</td> I wanted to insert this way: <td>@item.OrderSendº</td> But when you join the º character with...
asked by 11.05.2017 / 14:26
2
answers

Edit MVC with Foreign Key

I need to improve on my editLivros , then I'll explain my project. Autores ------- IdAutor Nome Livros -------- IdLivro Nome IdAutor I am registering the Authors and Books correctly, when I register the Livro , I make a View...
asked by 19.11.2015 / 19:04
1
answer

GetEnumerator Error When Rendering a View

I did this just as a test: @model Operador.MVC.Models.OperadorModel @{ ViewBag.Title = "Operador"; } <table id="tblOperador" class="table table-hover table-striped" border="1" cellspacing="0" style="width: 100%;"> <thead>...
asked by 08.10.2015 / 18:29
1
answer

How to "escape" the @ in Razor

I'm trying to leave @ as a string. Here is the code: hint: { mentions: ['Pedro', 'Tiago', 'João', 'Maria'], match: /\B@(\w*)$/, // Problema com @ search: function (keyword, callback) { callback($.grep(this.mentions, function (item) {...
asked by 12.12.2016 / 23:26
2
answers

Span within @ Html.ActionLink

I have the following column of a table: <td style="font-size:10%"> <p class="list-group-item-text"> @Html.ActionLink((string)item.cidadenome, "Cidade", "Cidade", new { cidadecod = item.cidadecod, contratocod = item.contrat...
asked by 08.09.2016 / 21:25
2
answers

Fields in the same line Bootstrap application MVC5

I would like a hint of putting two fields on the same line in Razor, using the bootstrap in an ASP.NET MVC5 application. div class="ibox-content"> <form role="form" class="form-inline">...
asked by 26.07.2016 / 21:15
1
answer

What is the advantage of using Tag Helpers in ASP.Net Core?

I'm studying ASP.NET Core and came across the tag helpers when I generated the scaffold of a view . I found the new syntax interesting, the code is more readable on some points, however, adding another DLL to all views that used tag help...
asked by 30.12.2015 / 13:25
1
answer

How to print text within an @if {} condition in Asp.Net in the cshtml file?

I have the following situation <td> @Html.DisplayFor(modelItem => item.HoraInicial) às @Html.DisplayFor(modelItem => item.HoraFinal) <br /> @Html.DisplayFor(modelItem => item.HoraInicial2) @if (!item.HoraF...
asked by 27.01.2017 / 23:56
3
answers

SQL Query export to excel

Good, I have some difficulties in the result of a query. For you to fit it is as follows, I have a registration application of "unavailable." and I need the following: Every day I have to extract a report from the previous day, however thi...
asked by 16.09.2014 / 14:56
1
answer

Pass the return (integer) of a method from Controller to View

I have this method in a controller : int GetSpot() { List<CompanyDetail> topCompanies = GetTopCompanies(); CompanyDetail topCompany1 = topCompanies.Where(x => x.Company.TopCompany == 1).FirstOrDefault(); if (topCompany1 ==...
asked by 08.02.2017 / 19:28