Questions tagged as 'asp.net-mvc'

1
answer

Generate new migrations based on all models

I need to create a migrations with all the created models (I just deleted the first migration and I'm not able to create the authentication database).     
asked by 28.09.2018 / 04:17
1
answer

Good practices for Asp.Net MVC 4 - 5

I need to know how to organize my project in the% cos_de% issue if there is more than one Model in my application. For example, I have the Model student and Model teacher. I create a class of type CRUD's to manage my database, but e...
asked by 14.02.2014 / 04:57
2
answers

Is it possible to get any value from the browser that identifies the user's machine?

Problem I'm researching some way to identify and validate workstations, and would like to get some value from the machine that is not changeable, such as IP that can change. I tried to get MAC address , but it does not seem possible bec...
asked by 01.09.2014 / 15:12
1
answer

Correct Statement Classes Model MVC Ninject

I started using OO a short time ago and in all projects that I see on the net, I see the following way of declaration. public class Trabalhador { public int Id { get; set; } public string Nome { get; set; } public virtual ICollecti...
asked by 19.05.2014 / 01:55
3
answers

How to test Filters that verify Claim data?

I have a ActionFilter for some controllers and actions that make use of the user information that is in claims . The filter itself gets the user's claims information and performs the authorization validation process: public vo...
asked by 23.11.2015 / 12:59
1
answer

Return data as JSON using ASP.NET MVC

When developing a web application, using ASP.NET MVC, I need to return the view layer, data as JSON in the following format: { 'title': 'Gallery 1', 'description': 'Description of gallery...', 'thumbnail': [...
asked by 25.12.2015 / 14:52
1
answer

Error after performing an action redirect to a page

I think I'm going wrong with the code below, it should save the Client and redirect to the Client / Index page, but after saving it stays on the same page, using Debug it passes in the Client / Index (Action and View) , but does not open the pag...
asked by 25.11.2015 / 12:32
1
answer

Ajax in different project

I have a project in Asp.Net MVC with the following method: public ActionResult ObterCursos() { List<curso> cursos = new List<curso>(); curso curso_ = new curso(); curso_.Nome = "Análise"; curso_.Periodo = 3; cu...
asked by 05.06.2015 / 04:18
1
answer

What is the assignment in the Action parameter, method?

I had a question about some of the codes that I found in a project of a former employee of the company. It is a code that contains assignment in the variables parameters. Here is an example: public ActionResult Teste(long id = 0, String tema =...
asked by 22.06.2015 / 15:26
2
answers

File upload does not work on Locaweb hosting

Locally I can upload and quietly save a file using the following code Controller: public ActionResult CriarProduto(FormCollection form, HttpPostedFileBase file) { Produto produto = new Produto(); ProdutoService prod = new ProdutoServi...
asked by 01.08.2014 / 19:51