Date Format to dd/MM/yyyy in TextBorFor type date

I'm working on a project that require to introduce dates to create many objects. When I'm testing it on Chrome, there's no problem. The problem is when I'm running it on Firefox or Internet Explorer. For Example, on Chrome I use this line (it works...
more »

2017-01-13 10:01 (2) Answers

ASP.NET Web Api returns bad data

I've generated my Web Api Controller by scaffolding, I added WebApiConfig and Web Api works but returns bad data. For example: I have some entities - Player with attributes ID name, surname etc. and PositionId, Position with attributes name and ID....
more »

2017-01-13 00:01 (2) Answers

ASP.NET MVC Authorization Filter

If I register a global Authorize attribute in FilterConfig.cs so that each action method can only be accessible to authenticated users, and decorate some controllers with [Authorize(Role="Admin")] so that only admin users can access them, does author...
more »

2017-01-12 22:01 (1) Answers

Getting difference between two dates in days

I have a specific problem where I have records in my DB table like the following: LastUpdated 10 January 2017 (The dates are stored in the database as a DateTime type.) Now I need to fetch the difference in days between today's date and the last...
more »

2017-01-12 21:01 (1) Answers

Clear Session in ASP .NET MVC 5?

I have a question. I work in ASP .NET MVC 5 . I want to prevent is that , after logging out , then I click the back navigation button , I don't want to go back to the previous page . Is there anyone who can help me? I use Session Clear and Abandon me...
more »

2017-01-12 12:01 (3) Answers

AutoMapper is giving invalid operation exception

On my edit page, I was receiving this error: Attaching an entity of type failed because another entity of the same type already has the same primary key value. So, I researched that and came to this. That lead me to want to use Auto-Mapper, to...
more »

2017-01-11 19:01 (3) Answers

Add JavaScript files in asp.net mvc

I am new in asp.net mvc and I am trying to include .js files in my project but I could not access it on my browser. Like it. @Scripts.Render("~/bundles/responds.js") @Scripts.Render("~/bundles/jquery-1.11.3.min.js") @Scripts.Render("~/bundles/jssor....
more »

2017-01-11 11:01 (2) Answers

ASP.NET C# Ajax Call Error

I'm going straight to the point here. I'm trying to get the value pass from my ajax to controller and console.log the value. however, when I try to console.log the value it gives me error 500.. here's my code: I've been doing ajax on php for a l...
more »

2017-01-11 03:01 (2) Answers

Safely transfer credit from one user to another

I'm working on a website in which I use Asp.Net MVC with Entity Framework 6. Each user has a credit and sometimes users can transfer their credit to other users. The simple approach would be this: public class ApplicationUser : IdentityUser { //...
more »

2017-01-10 18:01 (3) Answers

Date format - Ajax request

I have two fields date in my form (frm-Pesquisa-Totais-Tempos-UM) and i'm using Jquery serialize to send that informations to controller: $('.input-daterange').datepicker({ format: "dd/mm/yyyy", todayBtn: "linked", language: "pt-B...
more »

2017-01-10 13:01 (0) Answers

Display Dynamic Fields with Radio Buttons in MVC

I have a partial view in my MVC site that is used for search parameters for a specific page. In this partial, I am displaying parameters dynamically based on a specific ID number. Some of these parameters need to allow the user to either enter an e...
more »

2017-01-09 22:01 (2) Answers

Scaffold a Date and Time Picker

When scaffolding a view from a model with the property below it produces code that renders a browser date picker which works great. How can you scaffold a property that produces a date and TIME picker? [Display(Name = "Date Start")] [DataType(DataT...
more »

2017-01-09 11:01 (1) Answers

MVC 5 Get Exif data for Camera make

I am trying to Get Exif data for Camera make, ISO speed etc. in a file upload. I can get some tags (see below) but need some guidance on extracting items from the Exif directories. Any suggestions please. IEnumerable<MetadataExtracto...
more »

2017-01-08 19:01 (3) Answers

How to use multiple GET action in a WebApi?

Well I am actually trying to learn the WebApi and suppose if i have a scenario where i have two get methods like this CONTROLLER public class EmployeeApiController : ApiController { public List<Student> GetAllStudents() { ... } publi...
more »

2017-01-08 18:01 (2) Answers