Questions tagged as 'razor'

1
answer

Render HTML5 with Razor

According to W3Schools an input does not have ex tag closing <input type="text" name="firstname" value="Mickey"> source: link In my ASP.NET MVC project I have the following command @Html.TextBoxFor(model => model.Erro, new {...
asked by 10.03.2016 / 21:01
2
answers

Add @onchange in EditorFor using Razor

Hello, I'm trying to add @onchange to my EditorFor , so I'll have to add that field dynamically CURRENT LINE @Html.EditorFor(model => model.CEP, new { @class = "classe" }, new { @onchange = "myfunction(id)" } }) In my case, I...
asked by 10.12.2015 / 14:42
2
answers

Razor in javascript file

I have a small code that works in _Layout : $.ajax({ type: "POST", url: "@Url.Action("Action", "Controller")", success: function () { //Seu código aqui ... } }); So far everything works fine, but _Layout is gett...
asked by 28.07.2017 / 21:51
2
answers

Hide Menu Tab

I'm trying to hide the nav menu bar when it enters a specific form, would you like to give some example? Thisistheindexofmyform:@usingPagedList.Mvc;@modelPagedList.IPagedList<BlogWeb.Models.Abastecimento><!DOCTYPEHTML><p>@H...
asked by 29.05.2018 / 13:19
1
answer

Question: Search with DropDownlist mvc 4 razor asp.net C # sql Server [closed]

I am having difficulty popping the dropdown with sql server, because it comes repeated sql item ... ex: when I select the cities it comes with repeated cities and so on, and I can not direct to the search page. follow the code Controller Home...
asked by 12.09.2016 / 21:09
1
answer

@ Html.DropDownListFor how to set the default value

I need to set the default value displayed by a @Html.DropDownListFor Searching found: @ Html.DropDownListFor how to set default value So, I did it in my code: @Html.DropDownListFor(model => model.equipe, new SelectList(ViewB...
asked by 01.08.2017 / 13:59
1
answer

How to pass ID via JavaScript to a View

In the application I'm developing I use Views of type modal . I use this code to display the modal : <button class="btn btn-default details" data-id="@clientes.Codigo"><i class="glyphicon glyphicon-file"></i></button&g...
asked by 15.10.2015 / 02:35
2
answers

How to render two Views typed in an Index ()?

I'm trying to render two views created with scaffolding, one is for Create and another is for the List in>. The idea is to add the following to index : @model BraveryBranded.ASP.Models.News @{ ViewBag.Title = "Index"; } @Render...
asked by 07.02.2014 / 22:59
1
answer

What are the differences between ASP.Net MVC and ASP.Net Razor Pages?

What are the differences and limitations between ASP.Net MVC and ASP.Net Razor Pages? I was curious, as apparently the Razor Pages use the MVC standard, but without the need to use a controller , I do not even know if this is really it, and...
asked by 12.02.2018 / 21:27
1
answer

How to clean an @Html.TextboxFor using JavaScript?

I'm trying to clear the value entered in the TextBoxFor field from the following form shortly after the submit. @BHS_Treinamento.WebApi.Models.Curso @{ ViewBag.Title = "Cadastrar"; } <h1>Cadastrar</h1> @using (Html.Be...
asked by 23.02.2018 / 19:32