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

2
answers

Problems with Web.Config

I'm having difficulty using multiple web.config on my system. In my web.config main I have the following configuration: <configuration> <appSettings> <add key="BASE_URL" value="/mvc/" /> </appSettings> &l...
asked by 28.08.2014 / 19:49
1
answer

SubModel Conditional Validation MVC 4 C #

I have the following problem (I will simplify the classes to facilitate understanding): public class Class1 { [Required] public int? Id_Estabelecimento { get; set; } public string Nm_Nome { get; set; } } public class Class2 {...
asked by 26.08.2014 / 23:02
2
answers

Client-Side Validation (Jquery) conditional attribute

Late! I am performing a complex validation on a specific class with the following code (reduced for simplicity): public class Classe1 : IValidatableObject { [Key] public int Id_Classe1 { get; set; } [Required] public int Id...
asked by 29.08.2014 / 18:28
2
answers

Create and Edit OneToMany with ViewModel

I'm creating a simple news application in ASP.NET MVC 4. I have a News category and a Category. I made a ViewModel public class NoticiaCategoriaVM { public Noticia Noticia { get; set; } public SelectList Categorias { get; set; }...
asked by 07.03.2014 / 20:44
1
answer

In an MVC 4 C # Web Application model, on what layer can the ADO.NET Entity Data Model file be?

On what layer do I put it? Model control or view? ADO.NET Entity Data Model which connects to the database.     
asked by 16.11.2017 / 15:41
0
answers

unable to start program 'C: \ Program Files (x86) \ IIS Express \ iisexpress.exe'

My visual studio from night to day started to give an error when starting the application, this error only happens the first time I start the application (asp.net mvc 4), at other times iis starts and stops at same time Error:    "unable t...
asked by 10.01.2017 / 21:53
0
answers

Using Moq with MVC DotNet

I'm using MVC4 with Moq and would like to know how to mock my Model and also if that's possible. Thank you.     
asked by 12.08.2015 / 01:49
2
answers

Button / link within a view redirecting to another view

I have the following address of a view : http://localhost/Configuracao/Details/1 Where to create a button / link that redirects to another address of another view as follows: <a href="@Url.Action("~/Views/Ativos/Index", Mo...
asked by 20.02.2015 / 19:20
3
answers

Sending temporary information between classes with C # 4.0 MVC 4

Working with a VS 2015 solution that has 2 sites, "projectA.site.com.br" and "projectB.site.com.br", their views and controllers are in the same project, named as "WEB", developed in C # .NET 4 with MVC 4, but in two folders, "Project A" and "Pr...
asked by 18.01.2017 / 13:58
1
answer

Error "Access-Control-Allow-Origin header is present on the requested resource" [duplicate]

I need to insert an API on my site that provides the weather forecast for a particular city, however, the ajax request always returns the error in the browser console. Follow below: XMLHttpRequest cannot load http://developers.agencia...
asked by 07.08.2015 / 23:03