Questions tagged as 'razor'

1
answer

Create a dropdownlist and grab the selected id Asp.net MVC

I need to create a Dropdownlist at run time with 2 options to choose from. With this, I need to do a check by picking the selected record and then accessing that method. This is after clicking a ActionLink . How do I set an id fo...
asked by 10.08.2015 / 14:50
1
answer

Summarizing Selected Columns

I have the following scenario: A table created in the razor with several columns, where each row has a checkbox in place different from each other, and would like to do the checkbox sum clicked by column via javascript, but I have no idea whe...
asked by 17.07.2015 / 21:11
1
answer

@ Html.ActionLink submitting form Post MVC

@using (Html.BeginForm("MinhaAction", "MeuController", FormMethod.Post )) { <div> <table> <thead> <tr> <th>Empresa</th> <th>...
asked by 12.05.2015 / 19:02
2
answers

Model error on a razor page

I have this cshtml @model IEnumerable<TreinamentoCrud.Models.Cidade> @{ ViewBag.Title = "Index"; } <h2>Index</h2> <p> @Html.ActionLink("Create New", "Create") </p> <table class="table"> <tr...
asked by 09.08.2018 / 15:28
1
answer

Manipulating RadioButton to have no value in any field

I need some help from you: I have two radiobutton , and I wanted to turn them into checkbox , only I can not change type to checkbox , in this radio I could make to select and to remove if you want. Could anyone help...
asked by 09.03.2017 / 13:51
1
answer

Put variables in the URL in MVC to use with JS

I have a search page that will fetch the results using ajax. Do the searches you do, the URL is always the same, because the page does not change. Is there any way for me to change the URL also when I do the search? Ex: I wanted to have a variab...
asked by 13.01.2017 / 11:32
1
answer

HTML attributes in webgrid lines

Is it possible to include the data-id-tarefa="@item.id" attribute within each TR using the WebGrid? I can include in the JavaScript the attribute, but all the TRs return the same value of the id inside the attribute and what I need is the...
asked by 11.06.2015 / 13:55
1
answer

Difference between @Html.LabelFor and @Html.DisplayNameFor

I'm starting in ASP.NET MVC and doing a course where the teacher used to display data from a class different methods for displaying a given. It uses @Html.LabelFor and @Html.DisplayNameFor . From what I have read in other forums%...
asked by 12.01.2018 / 17:25
3
answers

Persist information using ViewBag?

I have my login screen and want to show the name is the user id logged on another screen, so I can use this information. In my controller : [HttpPost] public ActionResult Index(TB_USUARIO model) { //aqui vai pesquisa...
asked by 28.12.2015 / 18:16
1
answer

ASP.NET Text-Box Character Limiter

I'm trying to implement a character limiter for this text-box, but I have no idea how to do this. It is a page of insertion of posts in a portal and the title must have a limit. <div class="form-group col-md-12"> <div class="form-...
asked by 25.08.2017 / 21:56