Questions tagged as 'asp.net-mvc'

1
answer

Load a table dynamically with ajax

I am trying to mount a table by making a request to the server and populating it with the return. The return of the server is correct, but when it enters the function(data) , I noticed that it loads all my html page, I already tr...
asked by 03.05.2017 / 17:57
1
answer

How to return several values of a class?

Follow the code below: Controller: public ActionResult teste1(int num1, int num2) { // Aqui quero obter os valores da variável model1 e model2 da classe MyClass var result = MyClass.Teste2(num1 , num2); } Model: public class M...
asked by 03.05.2017 / 04:23
1
answer

Assign HTML code to a Jquery alert

I'm using this alert, but I wanted to insert a text break window.alert("Não existe produto cadastrado no sistema! Para continuar devemos cadastrar pelo menos um produto"); I wanted to break the line after the exclamation, how do I get it in...
asked by 12.11.2016 / 21:41
1
answer

asp.net HTTP Client get with query string

Developed in an asp.net mvc I intend to implement an HTTP request that with this part of the code the meteorologies present me a "list" with the metrics of the query data_de_leitura=2016-11-11&hora_de_leitura={null} ie 3 meteor...
asked by 14.11.2016 / 01:34
1
answer

Foreach without repeating the name

I have a Foreach in View, and it contains Description, qtd and dta, how do I make a foreach without repeating the description? Ex: I have a product X whose 10 units were removed on 10/1/2016, 3 units on 04/10/2016, 8 units on 10/15/2016, how do...
asked by 18.10.2016 / 07:07
2
answers

How to check if the query did not return data?

I have a query is would like to know if it returned data. //classe aplicação- private List<tb_cabecalho> TransformaReaderEmListaObjetos(SqlDataReader reader) { var retornando = new List<tb_cabecalho>(); while (reader.Read()...
asked by 07.10.2016 / 16:38
1
answer

Error (Connection String) Asp .Net MVC - Visual Studio 2013 and SQL Server 2012

I have a problem with my Asp.Net MVC application. I created the Connection String within Webconfig, <connectionStrings> <add name="connSql" providerName="System.Data.SqlClient" connectionString="Data Source=localhos...
asked by 27.10.2016 / 18:57
1
answer

Validating Empty DropDownList

I have the following DropDownList: @Html.DropDownList("HorasPendenciaID", null, new { @class = "dropdown-custom" }) When you ' 0 ' in your value it is empty. I would like to validate if the DropDown is set to zero or not and display a me...
asked by 14.09.2016 / 16:28
1
answer

DisplayName does not work in relationship

I have a model : public class TalaoCode : ITalaoCode { [Key] public int TalaoCodeId { get; set; } [DisplayName("Equipe")] public int EquipeId { get; set; } [DisplayName("Equipe")] public v...
asked by 28.12.2016 / 13:57
3
answers

Is it possible to call the same method on all Controller asp..net mvc without having to repeat the code?

On my Controller Home, I have this: /// <summary> /// Aqui estou trocando o idioma da página de acordo cam a seleção do /// usuário. /// </summary> /// public ActionResult AlteraIdioma(...
asked by 19.10.2016 / 15:49