Questions tagged as 'asp.net-mvc-5'

1
answer

Complex linq query when passing parameters

I need to do a linq query, but I'm having a hard time doing it. I have 5 filters on the page. Being that three of them come from three dropdown (select). I can only consider select, if the text in them are different from "NO FILTER", first step....
asked by 26.06.2014 / 14:17
1
answer

Asynchronous module or handler completed while asynchronous operation was pending

I'm trying to send an email asynchronously, without having to wait for the return. But when I do not use await I get an exception on return to action . Code:publicTaskMissaoAvaliada(stringusuario,stringdestinatario){_email.From=new...
asked by 30.08.2017 / 02:58
1
answer

How to call another action and return the value?

Follow the code below: public ActionResult Teste1(int num1, int num2) { var valor = Teste2(1, 2); //Aqui recebe valor nulo } public ActionResult Teste2(int num11, int num22) { //Alguns valores aqui... var valor = 123; return null;...
asked by 03.05.2017 / 00:21
1
answer

How to customize "Confirmation window"?

Follow the code: @using (Ajax.BeginForm("Action", "Controller", new AjaxOptions { HttpMethod = "POST", OnSuccess = "OnSuccess", Confirm= "Tem certeza ?" }, new { @class = "form-horizontal", role = "form" })) { } How can I customize a...
asked by 04.04.2017 / 00:41
2
answers

Catch a selected item in Dropdownlistfor using an ASP.NET MVC ViewModel

I'm trying to register a Subcategory that needs a Category. I have the SubCategoryViewModel, where I created the public IEnumerable<CategoriaViewModel> Categorias { get; set; } and public Guid CategoriaId { get; set; } fields...
asked by 17.02.2017 / 01:06
1
answer

Display text coming from the database query in @ Html.Actionlink ()

Well, I have the following scenario: I query the database and I bring a IEnumerable<> to View : <section class="container"> <article class="row"> @foreach (var item in Model) {...
asked by 03.02.2017 / 03:52
2
answers

Toggle - get result true or false

Follow the code: Model: public bool teste{ get; set; } View: <div class="checkbox"> @Html.CheckBoxFor(model => model.teste) </div> HTML result: <div class="checkbox"> <div class="lcs_wrap">...
asked by 05.01.2017 / 07:40
1
answer

How to resize image independent of size?

Follow the code below: public FileContentResult Foto_Pequeno() { byte[] byte_image = null; string query = "SELECT * FROM Imagem WHERE Id = '1'"; using (var connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn...
asked by 03.01.2017 / 20:10
1
answer

Boxes of selections required at least 1 with Data Annotations

No model I have: [Display(Name = "Exemplo 1")] [Range(typeof(bool), "true", "true", ErrorMessage = "Erro, marcar como true")] public bool Exemplo1 { get; set; } [Display(Name = "Exemplo 2")] public bool Exemplo2 { get; set; } [Display(Name...
asked by 02.01.2017 / 20:47
1
answer

Element 'configuration' not declared

In% w / o, the problem occurs on the line: <configuration> Error list: Web.config Any solution?     
asked by 09.05.2017 / 03:04