Questions tagged as 'razor'

1
answer

How to create master-detail form using a ViewModel

I have a viewmodel in my project. Inside it I have two entities which are a list of items. I'm doing the data-editing logic for these entities that are within the viewmodel . I have 5 entities in all. The ones that are not a list, I get th...
asked by 20.06.2016 / 04:44
1
answer

How to insert an information of a model that has a Relationship?

I have a list of Products and this listing has the vendor code, I need to enter the vendor name in that listing. My Controller: public ActionResult Index() { IEnumerable<Produto> produtos = db.Produto...
asked by 03.12.2015 / 20:08
1
answer

TAB key navigate only in MODAL

Good morning, people, I need to make the TAB key navigate only in modal, an example is Twitter that when the Modal message is open or any other, we can not navigate the screen behind through the TAB, someone has an idea of how it is done ?  ...
asked by 01.12.2015 / 13:06
1
answer

@ Html.EditorFor for DateTime property remove hh: mm: ss

In my model I have a field DateTime called DataReferencia , I formatted with Attributes , however when I am in view hh:mm:ss I just want to date 2/29/2016 . Model [Column("sdt_DataReferencia")] [DisplayFormat(ApplyFor...
asked by 29.02.2016 / 18:28
1
answer

Dropdown List coming from a table in the Database

I'm developing at asp.net- mvc and I have the following problem: I need to create a dropdown list that displays the name of the instructors registered in the Database. The CRUD is already working perfectly. I used the Entity Framework...
asked by 29.06.2015 / 17:50
2
answers

@If inside a body tag

How to put a if condition inside a <body> tag? When trying to do: @if (Request.Path.Substring(Request.Path.LastIndexOf("/") + 1).ToLower() == "default") { <body class="home" } else { <body> } It does...
asked by 21.05.2015 / 19:16
1
answer

How to apply a mask in these cases?

How to put mask on item @item.CPFCNPJDevedor ? @foreach (var item in Model.Result) { <tr> @if (Permissoes.Where(x => x.Acao == "EditChassiCrvGravame" || x.Acao == "...
asked by 07.05.2015 / 22:08
1
answer

How to assign JavaScript value in Razor?

I have a Razor @minhaVarRazor variable and would like to change its value based on a value obtained from another variable, but that is JavaScript . function setValue(minhaVarJavaScript){ @minhaVarRazor = minhaVarJavaScript; } D...
asked by 22.07.2015 / 22:29
2
answers

Calling action with AJAX, but does not return alert for view

In textbox Ticket , in event onChange() I call AJAX below: $('#Ticket').on('change', function () { var tkt = this.value; $.ajax({ url: '@Url.Action("VerificaTicket", "Oc")', data: { 'tkt': tkt }...
asked by 03.03.2014 / 17:55
1
answer

Convert value to display in table - mvc asp-net.core

I have a table that returns me a value in int and I need to convert this value to time, how can I perform this procedure, in case I would need to create a function to show me the correct value. <td> @Html.DisplayFor(modelItem =&g...
asked by 05.06.2018 / 22:27