Questions tagged as 'asp.net-mvc'

2
answers

Asp.net MVC4 on IIS 6 - Page not found

I am having problems publishing an ASP.NET MVC4 application to an IIS 6. The settings appear to be correct, but the browser displays "404 error." Has anyone ever been through this?     
asked by 26.02.2014 / 20:54
1
answer

Simulate a Master / Detail report with foreach

I have a table as follows: public class Producao { string unidade; string profissional; string procedimento; } I can get all the records stored in the table and throw them in a listaProducao list. And list them by fore...
asked by 07.07.2017 / 04:56
1
answer

What is the GUID for Visual Studio projects

I have a "base" project in C # MVC (login, access control and related), to replicate in other projects, which is to copy the fonts and sometimes rename the project. Do I have to change the GUID of the assembly? What is it for? Are there any pr...
asked by 28.07.2017 / 00:45
2
answers

C # check "null" or "NaN" or "false" or "0"

I'm having a validation difficulty. I have View that sends to Controller information, where view is used knockoutjs , however it has time it sends null or "null" or "NaN" or "false" or "0...
asked by 09.08.2017 / 16:21
1
answer

Pass the return (integer) of a method from Controller to View

I have this method in a controller : int GetSpot() { List<CompanyDetail> topCompanies = GetTopCompanies(); CompanyDetail topCompany1 = topCompanies.Where(x => x.Company.TopCompany == 1).FirstOrDefault(); if (topCompany1 ==...
asked by 08.02.2017 / 19:28
1
answer

AuthorizeAttribute in Controlller and Actions

When using an attribute (AuthorizeAttribute) developed by me (with Enums), it is not working as it should: When used to decorate the Controller declaration: [UserTypeAuthorize(TipoUsuario.Administrador)] public class UsuarioController : Bas...
asked by 12.01.2017 / 04:08
1
answer

How to get filenames inside folders on WEB server API

I have a directory File / Uploads AndIwouldliketolistallfiles,insidethisdirectoryIhaveNfolders.WhatI'veachievedsofarishere.stringpath=HttpContext.Current.Server.MapPath("~//Arquivos//Uploads"); string[] files = System.IO.Direct...
asked by 08.01.2017 / 00:20
1
answer

MIgrations, Updating a null field to not null

I'm updating the phone and CPF field of my User entity that was allowing nulls to non-null. follow the migration file public partial class Required_fild_users_cpf_phone : DbMigration { public override void Up() { AlterColumn("d...
asked by 01.12.2017 / 14:38
3
answers

LINQ with JOIN and where clause, how to do?

Good afternoon. I'm trying to make a left outer join (SQL) with LINQ, however, I'm not getting it. The code for my class, this is below. Can anyone give me a light on how to solve this? public class PessoaController : Controller {...
asked by 01.01.2018 / 17:46
1
answer

Convert a Session to Boolean - asp.net mvc?

I have in my system a Session that stores an information "S" or "N" Session["Administrador"] = retorno.ADMINISTRADOR; In the layout I want to make the conversion of it to boolean @{ bool administrador = bool.Parse(Session["Adminis...
asked by 09.11.2016 / 14:29