Questions tagged as 'asp.net-mvc'

1
answer

Define virtual field name

I have the following code in my model SubGrupo : namespace Aplicacao.Core.Dominio { public class SubGrupo { [Key] public int Codigo { get; set; } [Required(ErrorMessage = "Campo Obrigatório.")] pu...
asked by 10.09.2015 / 22:10
3
answers

ViewData is not displaying a post

I'm trying to send a message from Controller to View, using ViewData, but it's not displaying the message. When I click on the "Check" button of the View it is to call the Verificar() method of the Controller, it is calling correctly,...
asked by 08.09.2015 / 21:58
1
answer

Problem creating reportviewer in asp.net mvc

I installed the "Install-Package MvcReportViewer" package via the Package Manager Console and trying to create the ReportViewer gives an error of not finding the reference. My code: View @using MvcReportViewer; <-- Aqui dá erro <h...
asked by 10.09.2015 / 20:02
1
answer

Problem with page return according to profile C #

I'm trying to return a page according to the user profile registered at the bank. If his profile is "Admin", he returns another page. I try with the Administrator profile and it works, already from another user, I changed his profile in the bank...
asked by 23.06.2015 / 20:19
1
answer

How to get type of user in view?

I have an Asp.Net MVC project that uses Individual User Account with Owin . Everything is working perfectly, but I would like to get the user type ( role ) in View . Home I'm using Request.IsAuthenticated to know if the use...
asked by 08.06.2015 / 15:19
2
answers

Problem with a Count in Asp.Net MVC

My application manages courses, on my registration screen I have a field "number of vacancies" where it is decremented each time a student enrolls in a course. The problem now is that my Count is denying the "number of vacancies" field. On t...
asked by 08.06.2015 / 21:07
2
answers

IoC with Ninject

I'm developing an application using IoC and Ninject for dependency injection, and I came across the following problem: When uploading my application to the server I get the following error: Can anyone help me with how to resolve this e...
asked by 17.03.2015 / 23:19
1
answer

Asp.Net Drop Down List

How do I pass%% by parameter? I tried to pass, for example: public void preencheDrop(string SQL, WebControl x) { método aqui. } But I could not. This method I just want to make it easier for me to fill up more than a dropdownlist...
asked by 01.07.2015 / 15:04
1
answer

EF 6 Code First: Decimal field gives error when trying to save

Hello, good morning. I have a class that has a decimal field where I save the price. So far so good. When it is displayed in the / Edit / of the page, it is also beauty. But that's the problem: 1 - The MVC (which I am using 4 with EF 6) it di...
asked by 04.07.2015 / 10:30
1
answer

How to always keep 1 record in DB after inserting with entityframework?

I'm developing in .NET MVC using Entity framework, how do I save a data query whether there is a record or not in the table? 1. Query whether or not there is any data in the table 2. if you have any record, it adds replacing the previous element...
asked by 12.03.2015 / 21:06