Questions tagged as 'razor'

1
answer

MVC 5 Ajax.ActionLink returns result, but does not render in DOM

Gentlemen, I'm having trouble displaying a list of results in my view. The idea is, when I click on a value from a dropdown, I make an asynchronous query to populate the next dropdown. I would refer to the controller by the Ajax.ActionLink me...
asked by 07.01.2017 / 18:56
1
answer

How to load a PartialView to create a comment

I'm working on a project to learn ASP.NET MVC and Razor. I currently have a post template with a view , and a view associated with the model class comment to create a new comment. I would like to know how to do to put the view comm...
asked by 14.12.2016 / 20:53
1
answer

Validation for TextArea using Razor MVC 4

I have the following modal and need to include validations so that the textarea is required when clicking the "Yes" button, that is, it can not be sent blank, and that textarea is at least 15 characters. @model TClient <di...
asked by 03.02.2017 / 19:27
2
answers

Giving Hide on an ActionLink, is it possible?

I would like depending on whether my ActionLink was visible or not. Razor : <td> @Html.ActionLink("Cadastrar site","MontarFancyCadastrarSite", "ItemOS", new {ChaveOS = Model.ChaveOS }, new { @class = "siteFancybo...
asked by 03.01.2017 / 22:02
1
answer

How to fill an EditorFor as the username of the logged in user

I have a View , where the user must fill some fields, and have a last field that I left it disable , and I would like this field to appear the user name, however how do I fill in? Model : public class CombustivelModels {...
asked by 30.11.2016 / 19:05
1
answer

How much to use @ Html.ActionLink or Javascript

I'm having trouble understanding when to use @Html.ActionLink or javascript:document.getElementById('Comercial').submit() For example: <a><i class="fa fa-home"></i> Home <span class="fa fa-chevron-down">...
asked by 09.11.2016 / 16:50
2
answers

How to pass an IEnumerable Model to a Controller?

I have a page that correctly lists my records. But I have Html.BeginForm for each line, @model IEnumerable<Generico.Dominio.TB_POSSIBILIDADE> @{ ViewBag.Title = ""; } @if (Model.Count() > 0)...
asked by 28.07.2016 / 18:20
1
answer

ASP.NET form validation mvc!

I have a form that validates the fields when trying to send information, but I have a "novapagina" option where I would not like to validate the fields, would that be possible? In views <div class="container droppedHover"> <br/&...
asked by 28.12.2015 / 05:00
1
answer

Load table from view with JSON object

I have the following code in my controller : public JsonResult List(string nome){ IList<ClienteDto> clientes = string.IsNullOrEmpty(nome) ? _repositoryCliente.Get() : _repositoryCliente.GetByName(nome); var mo...
asked by 26.11.2015 / 17:56
1
answer

How to mount a list in Controller and mount a DropDownlist

I have the following difficulty. My address class has TipoEndereco , wanted to mount a dropdownlist Do I set up a list in the controller? Can I get her in the view? Thank you.     
asked by 10.12.2015 / 16:38