Questions tagged as 'asp.net-mvc'

2
answers

How can I create a CheckBox using the Html.CheckBoxFor Helper for a Nullable field?

My field is as follows in my class: public bool? meuCampo { get; set; } And in my view it looks like this: @Html.CheckBoxFor(m => m.meuCampo) But this way it is not allowed, because I can not explicitly convert type bool? to...
asked by 09.05.2016 / 18:10
3
answers

Console, WindowsForm or MVC which is the fastest for heavy loads?

I'm developing a program that will basically have the following cycle: Query in the database (some milliseconds) For each record, you will execute the following process: Início | Parse de um XML web (alguns milisegundos pra executar) |...
asked by 08.10.2016 / 02:13
4
answers

Check if user is logged in

I would like to know how to block access when the user is not logged into the system, however, the only page that can be accessed is the Login page and when it tries to access any other page it redirects to the login page, user to log on to the...
asked by 25.08.2015 / 15:23
3
answers

Capturing the user's real IP

How do I capture the real IP / Public IP of the user who is accessing the application? The IP of the computer I can capture normally, but I want to know the public IP of that client.     
asked by 03.09.2015 / 22:23
3
answers

How to filter an IEnumerable type list through another IEnumerable?

How to filter a list type IEnumerable<> by passing a parameter of type IEnumerable<> preferably via expression lambda or linq ? Based on the filter below, I expect this result: {MundoId = 0, Continente...
asked by 01.06.2017 / 13:28
2
answers

Doubt about the error "Error converting data type varchar to float"

   Error converting data type varchar to float This error is occurring when I make a Update in a table, below the code: SqlCommand cmd = new SqlCommand("UPDATE Notas SET nota = '" + nota.nota + "' WHERE idMateria = '" + nota.idMater...
asked by 09.12.2015 / 03:02
2
answers

Project based on spa template VS2015. How the service is generated

I created a project using the SPA template in Visual Studio 2015, to learn and understand, but I found this example very complicated. Still do not understand where the service is mounted and loaded?     
asked by 18.05.2017 / 22:52
2
answers

Best way to make class relationship

Hello, I would like to know what is the correct way to do relationship between classes of 1..N and 1 ... 1. Example: public class Pedido { public int PedidoID{get;set;} ............. } public class ItemPedido { public int ItemPedi...
asked by 14.06.2016 / 02:49
2
answers

Return DataReader to field type bool

I need to return a field that is of type bool : public List<TB_USUARIO> ListarTodos() { var strQuery = "select * from tb_usuario"; using (contexto = new Contexto()) { var retornoDataRead...
asked by 11.05.2016 / 17:36
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