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

2
answers

Put image in a bootstrap menu

How do I place an image in the right-hand corner of a menu bar with bootstrap. Below the code for my Layout (Master) <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width...
asked by 20.08.2014 / 20:15
2
answers

Bring three possible results with Lambda

I need in a single expression to bring three possible results. If date is up to 15dd, it returns 1, if it is between 15 and 45 dd returns 2 and if it is greater than 45 it returns 3. This is my lambda and the corresponding date field. var resu...
asked by 05.05.2014 / 20:52
2
answers

Pass parameters by jquery to controller

I have a method in the controller (void) that receives some parameters (3). I can not get into the method. Of the other times I did, passing to an object there, I have succeeded, with method returning a json. Well, this is a void method and I do...
asked by 18.06.2014 / 18:08
1
answer

Pass a list of View objects to the Controller

I have a Client class and an address, and a client can have many addresses. I'm trying to create a View Client where I can add as many clients as I want, and then add those addresses to the Client. But it does not return the address list when I...
asked by 30.04.2015 / 17:05
3
answers

Error trying to send email

I'm trying to send emails (using my hotmail account) and I'm encountering the error below:   Aconnectionattemptfailedbecausetheconnectedcomponentdidnot  responded\r\nwithaperiodoftimeortheconnection  establishedfailed\r\nbecausetheconnectedhost...
asked by 04.11.2015 / 12:47
1
answer

How to remove the / home / URL of a View specifies ASP.NET MVC5

I need to create a View called BancoDeImagens but I need to have it's URL instead of: www.site.com/home/ImageBank I would like to remove /home/ and separate names by - to look like this: www.site.com/banco-de-imag...
asked by 29.06.2018 / 20:42
1
answer

Loading RenderAction inside _Layout

How do I load data from a model into my _Layout ? I have a default layout for all views of my project where in this layout is the div where is the user photo that is in my application at the moment, so I would have to...
asked by 28.11.2016 / 17:28
1
answer

One of the fields must be mandatory - DataAnnotation [duplicate]

Code sample: Model: [Required(ErrorMessage = "Campo CPF ou CNPJ obrigatório")] [Display(Name = "CPF")] public string CPF { get; set; } [Display(Name = "CNPJ")] public string CNPJ { get; set; } User must fill in one of the CPF or CNP...
asked by 24.04.2017 / 22:04
3
answers

Error in ASP.MVC "Can not find resource"

I'm starting in ASP.NET and tried to create a test app. When running through Visual Studio I get the error of print. I created a standard MVC 5 project, created the controller model and view each in its proper location. EDITAsIwouldthe...
asked by 05.05.2017 / 21:18
1
answer

ASP.NET MVC Calculate value in a table

I am developing a register where I will have a table with some additional details that must be inserted together with the main register. But one of the columns of this table is calculated, which is where I'm having difficulty pe...
asked by 28.04.2016 / 02:05