Questions tagged as 'razor'

2
answers

How to change CheckBox with onChange from DropDownList in ASP.NET MVC Table?

I'm developing a site with ASP.NET MVC and Razor, I have one table with a few columns in one of my pages. I have in this table a State column which has a CheckBox and another column containing a DropDownList with some options. I would like...
asked by 20.05.2016 / 14:27
1
answer

Doubt with mvc list editing, using checkbox and editable field

I'm a little doubtful and I barely know where to start, so I'm going to turn to college students: I have a page with% as% (I am using asp.net-mvc ). It has a list, assuming the elements are A, B, C, D, E. The value of these elements comes fr...
asked by 29.06.2015 / 17:26
2
answers

How to make a LINQ / lambda and consume it in the view?

I have an object called Radio : public class Radio { public int RadioId { get; set; } public string StreamUrl { get; set; } public bool Ativo { get; set; } public bool Mp3 { get; set; } } I'm doing a select in control...
asked by 09.08.2015 / 14:45
2
answers

What's the difference between @ Url.Content ("~ / css / bootstrap.css") and only "/css/bootstrap.css"

I'm learning to program an application based on MVC4 and Bootstrap. Right at the beginning of the project I came across a puzzle: In _Layout.cshtml I had <link href="css/bootstrap.css" rel="stylesheet"> , Bootstrap worked fine i...
asked by 12.12.2016 / 19:09
2
answers

Referencing class Syntax Razor C #

I have a class where I have saved a configuration key being key and value, however I need to get the value of that key and pass it to my cshtml page. I'm having trouble with this. I've already passed the class path, but I can not refer...
asked by 21.07.2016 / 14:33
2
answers

How to Fill a DropDownListFor

Can anyone help me how do I fill out a DropDownListFor ? Before I was doing it this way: @Html.DropDownList("lstAffiliate", string.Empty); But I saw that it was not recommended, so I decided to do it with ListFor . I have...
asked by 15.06.2015 / 19:28
2
answers

Create Static SelectList and pass a selected item to View

I have a question about how to send my selectList "status" to my View EditarUsuario . I've created my list with the following items: var list = new SelectList(new[] { new{ID="2",Name="Selecione"}, new{ID="1",Name="A...
asked by 02.10.2015 / 22:42
2
answers

ASP.NET MVC Session

Personal I have a controller where I set two session keys and they capture these key anywhere in the application. (other controller , or a view ). The controller looks like this: [HttpGet] public ActionResult TimetableSelect(int curre...
asked by 24.05.2016 / 18:04
1
answer

How to retrieve user name logged in and display in View

I am trying to develop a page, where the user is logged in, he is redirected to an index, where he would like to display the user name. I'm using Identity default of ASP.NET MVC . Then I thought about putting the following cod...
asked by 09.11.2016 / 14:10
2
answers

How to access Action on another Controller via Ajax?

I have an AspNet MVC project structured as follows: Projeto L Areas L Area1 L Controllers L MeuControllerArea1Controller.cs...
asked by 28.08.2015 / 15:56