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

1
answer

How to add item in a request in asp.net c #?

I am developing a project that asks that items from a pizza restaurant be added to an order, not being a shopping cart, generating the order as if it were a cash program. I do not know how to add items to this request in a web project, any tips?...
asked by 19.11.2014 / 21:25
2
answers

NullReferenceException in User Filter

In my project I made a filter to see if the user is already logged in. To prevent it from logging in twice. According to the answer What happens is that I am having a zero reference error and I do not know why. I am passing the ID...
asked by 01.12.2014 / 21:22
1
answer

Generate MAC address hash and save to database

According to this my question to get the mac address of the network card and generate the hash, use the following methods: private string GetSHA1HashData(string data) { SHA1 sha1 = SHA1.Create(); byte[] hashData = sha1...
asked by 26.11.2014 / 00:03
1
answer

How to get cookie already existing via javascript

In my project I have a page that is html . And as my project is in ASP.NET MVC, I can not validate whether the user is logged in or not because that page is not razor . Searching, I found the javascript cookie , which creates, reads, and d...
asked by 26.11.2014 / 15:09
1
answer

Get Model in the View with values coming from the database

I have this class: public class MontaArvoreAcao { public int IDRuptura { get; set; } public DateTime DataRuptura { get; set; } public int IDMotivo { get; set; } public string Motivo { get; set; } public int IDOrigem { get;...
asked by 15.09.2014 / 13:37
2
answers

Make a foreach inside a cshtml

It is giving error the way I did the foreach. If you put @ gives error in the analyzer. If retreat gives other errors. How I do? Below is my complete code. @model Ruptura.Models.RupturaEntities @{ ViewBag.Title = "CadastroCargo"; Layo...
asked by 26.08.2014 / 19:41
1
answer

Doubt on how to set the type to return a list

I need to return some lists for my view. I am using ViewData. But have a problem, at the time of declaring the variable, I do not know what kind to put. I made the following form and it is giving the following error: foreach statement cannot...
asked by 18.09.2014 / 20:51
1
answer

LINQ with Left Join and Multiple Keys

My LINQ query does not give an error but does not display any results. Where did I go wrong? using (var db = new MyEntities()) { var result = (from dc in db.DiarioClasse join fn in db.Faltas on new { dc.Matricula, dc.CdD...
asked by 18.09.2014 / 17:40
1
answer

controller responsibility

I have my Model Bank public class Banco { public int Id {get;set;} public string Nome {get;set;} } and my model Bank Account public class ContaBancaria { public int Id{get;set;} public string Nome {get;set;} public Banco Banc...
asked by 17.09.2014 / 21:36
2
answers

Choose color in input type="submit" ...

How could I set a color for input . Below I have one of the input I use. <input type="submit" id="Submit69" class="btn btn-default btn-block" value="REP+H4" title="Clique Selecionar as Soluções" /> The value of the text I...
asked by 17.09.2014 / 16:51