Questions tagged as 'asp.net-mvc'

2
answers

Convert date 20171130 to 30/11/2017 format in string

I have this date field '20171130' saved in the database, and I need to convert to string formatting "30/11/2017" in my application, how to do this type of conversion? .     
asked by 01.12.2017 / 17:55
2
answers

How to write HTML within the Ajax success

I have a project in ASP.NET MVC 4 and in it I have a Ajax request where it calls the controller sending only one parameter. The request does everything correctly, it brings me a list of the data I need. What I want to kno...
asked by 19.03.2014 / 19:56
1
answer

Error saving list of related objects

I'm using BeginCollectionItem to insert objects related to a Cliente that I call Dependentes . When saving, I get the error:    Violation of the PRIMARY KEY constraint 'PK_dbo.Dependents'. It's not possible   insert the...
asked by 05.05.2017 / 14:03
2
answers

Create JavaScript mask using jQuery

I have a client registration page in my MVC project requesting default data like name, cpf, dt nasc ... I need to create masks of these fields. After searching I came to the DigitalBush plugin. So I liked it and I want to adhere to it. How...
asked by 05.05.2017 / 02:25
2
answers

Put social media buttons on the site

I'm "joking" with SPA MVC (C #) and would like to know how I put social media buttons on my site. I looked for some examples here on the site and by my query, I did not find anything that suited me. Another thing is that the examples I get on th...
asked by 16.05.2017 / 18:02
2
answers

How to use Chart.Js with ASP.NET MVC

Well, I am returning a list of and sending to View . You need to implement this using a graph with Chart.js . I have the Country class: [Table("Pais")] public class Pais { [Key] public Guid PaisId { get; set; } [R...
asked by 19.01.2017 / 14:32
3
answers

Logout with Identity

I am trying to use the logoff function offered by default in Identity: // POST: /Account/LogOff [HttpPost] [ValidateAntiForgeryToken] public ActionResult LogOff() { AuthenticationManager.SignOut(DefaultAuthenticatio...
asked by 04.10.2017 / 19:58
1
answer

Passing Parameters to Store Procedure

Follow the Search Function Code public List<Pessoa> Buscar(string Nome) { using(var db = new MyContext()) { var Result = db.Database.SqlQuery<Pessoa>("EXEC SP_Busca_Cliente @Nome", Nome).ToList(); return Re...
asked by 02.10.2017 / 15:17
2
answers

Result automatic calculation javascript asp.net mvc [duplicate]

I was able to sum the two fields using Java Script, but the result only displayed when clicking the result field, I would like to display the result automatically, without having to click anything. Javascript <script type="text/jav...
asked by 26.09.2016 / 15:18
1
answer

Why are you saying that this object is null?

papelX.moderador = abc.Id; papelX.participantes.Add(abc); I'm finding a NullReferenceException in this code above. I am creating a papelX object and will use some properties of the object abc . Visual Studio is saying that on...
asked by 23.06.2016 / 05:12