Questions tagged as 'razor'

3
answers

Align horizontally on opposite sides buttons with bootstrap

I have a form in which you can perform three actions: Enter employee, cancel and Save. I use bootstrap to create the form and the buttons as I show in the image The problem is that I would like the three buttons aligned horizontally...
asked by 31.03.2017 / 19:22
1
answer

CheckBoxFor in Razor with MySQL bit value

Could you help me please? I have in my database MySQL Bit fields (1), I do the Model and I work it in the controller with true or false ( Boolean ), until then everything is fine. In Razor I call my field...
asked by 02.12.2016 / 19:17
0
answers

Pass default values to child class functions in C # [closed]

I have a EmpleadoProgramador class that inherits from Empleado , with a CalcularSueldo() function that calculates the salary. I need it to have default values, without needing to pass them by argument. I could only make it...
asked by 09.05.2017 / 01:00
1
answer

View data is not updated

I have a list of clients that I have to update, but when changing the values, when I click on update, the original data reappears. Model Cliente : using System; using System.Collections.Generic; using System.Linq; using System.Web; n...
asked by 08.05.2017 / 19:40
1
answer

Send parameters from the view to the controller in C #

At the moment of receiving the parameters in the Controller from the View, the same arrive null, in the View I have the following code: @model Syc.Visitantes.Dominio.Entidades.Usuario @{ ViewBag.Title = "Crear Usuario"; } <h2>Crea...
asked by 23.04.2018 / 17:11
2
answers

Get properties of an ASP.NET file Razor C #

Hello, I'm doing a module in ASP.NET with Razor and C # where I upload a file of any type to a database , along with other data. I need to get the properties of the file on the server side ("with C # "), in order to be able to append thes...
asked by 27.10.2017 / 19:16
1
answer

Pass List from View to a Controller

I have a view where data is displayed in which data can be entered (Notes) @model IList<Proyecto01.Models.Nota> @{ ViewBag.Title = "Notas"; } <h2 class="text-center"> Notas</h2> @using (Html.BeginForm("ActualizarNotas",...
asked by 15.04.2017 / 08:16
2
answers

Access ViewData in a Razor view

I'm making a list of students to show it in a Razor view using ViewData. controller using ViewData.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace ViewBag.Control...
asked by 05.05.2017 / 00:52
1
answer

How do I show data in RAZOR MVC ASP.NET from SQL?

I have a SQL statement: var motivo = conexion.Query("SELECT * FROM historialvisitas WHERE idvisita ='"+rgtro+"' "); This table has several columns, how do I show via RAZOR @ the value of a specific column? Example: I want to sh...
asked by 14.03.2017 / 21:25
2
answers

How to leave the selected value using html.dropdowlist in MVC C # with aspx engine, similar to razor

I have the following definition of list of options: <% dynamic listItems_Afirmacion = new List<ListItem> { new ListItem { Text = "Si", Value = "S"},...
asked by 06.01.2017 / 02:22