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

1
answer

Is it possible to dynamically generate routes in ASP.NET MVC4

I'm fixing some URL's for my site and I need to create several different routes for each page, for example: routes.MapRoute( name: "ComoVenderMinhasImagens", url: "como-vender-minhas-imagens", defaults: new { controller = "Home", a...
asked by 09.10.2018 / 16:03
1
answer

Validate fraud attempt while editing registry with C # MVC

In my applications I was leaving the entity ID inside HTML being a hidden object. Example: @Html.HiddenFor(m => m.EntidadeID) But, I have identified that I can edit the HTML easily and in POST I can receive an invalid value. Before...
asked by 14.02.2018 / 17:51
2
answers

ListModel ActionResult () MVC

Personal I need a help to understand where I'm going wrong and how to fix a problem. I do not handle a lot of MVC, but I'm turning here. I need to pass a Model class as a parameter to an ActionResult, but the variable is being sent empty....
asked by 21.02.2017 / 17:06
1
answer

How to validate an IEnumerable property using DataAnnotations?

I want to validate this IEnumerable<long> selectedItems using select to check if it is empty because it needs to at least have a selected value. I have a IEnumerable it's to display a DataAnnotations to select mu...
asked by 21.10.2016 / 21:54
1
answer

MVC error 404 POST method

This is my controller : [HttpPost] public ActionResult TestePost(int id1) { ViewData["Teste"] = "O método POST funcionou, você digitou: " + id; return View("Index"); } [HttpGet] public ActionResult TesteGet(int id) {...
asked by 01.06.2016 / 04:06
1
answer

The parameter conversion from type 'System.String' to type 'RamalAguia.Models.Setor' failed because no type can convert between these types

While performing a project I came across the following error:   System.InvalidOperationException: The parameter conversion from type 'System.String' to type 'RamalAguia.Models.Setor' failed because no type can convert between these types....
asked by 02.06.2016 / 19:12
1
answer

How do I check the browser type, version and JavaScript support?

I need to identify the browser, browser version and if it is enabled to execute javascript. In previous versions of Asp.Net I checked Global.asax, using the command Request.Browser.JavaScript but this command is set to [deprecated] in the...
asked by 17.02.2016 / 13:19
0
answers

Records in ICollection navigation property are not being written

I'm trying to include items in a property of type list but I'm not able to include the records in the database. Firstly I have the following class models: public class Frota { public Frota() { Veiculos = new List<Veiculos&g...
asked by 11.12.2015 / 15:06
2
answers

Customize an item inside the css for a given view

I have this view in MVC View @model XXX @{ } <link href="/eTeste/Content/AbaDetailsODM.css" rel="stylesheet" type="text/css" /> <div id="consoleAbaDetalhes"></div> <div id="campos_detail"> @using (Ajax.Begi...
asked by 30.12.2015 / 12:47
0
answers

Doubt in the implementation of Rotativa in asp net mvc 4

I have a problem with rotating PDF generation, where I am putting a color image but when generating the report it appears in black and white and not colored as it should appear. Is there any procedure to be done? I'm calling my image this way in...
asked by 18.11.2015 / 18:53