0

This may be a silly question, but i'm performing a POST, and my integer fields are returning to my controller in hex values.

var VM = {
    cn_number: ko.observable(),
    engineer_id: ko.observable(),
    date_start: ko.observable(),
    paper_first_lot: ko.observable(),
    new_chemicals: ko.observable(),
    new_laborcodes: ko.observable(),
    new_equipment: ko.observable(),
    save: function () {
        var self = this;
        var token = $('[name=__RequestVerificationToken]').val();
        var headers = {};
        headers["__RequestVerificationToken"] = token;
        $.ajax({
            type: "POST",
            url: '/nris/Create',
            headers: headers,
            dataType: 'json',
            data: ko.toJSON(self),
            contentType: 'application/json',
            success: function (result) { },
            error: function (err) {
                if (err.responseText == "Creation Failed"){}
                 //   window.location.href = '/nris/Index/';
                else
                    alert("Status: " + err.responseText);
            }
        });
    },
};

my controller :

    [HttpPost]
    public string Create(DTO incomingModel)
    {
        if (ModelState.IsValid){            
            _nriRepository.InsertOrUpdateNRI(incomingModel);
            return "Created";
        }
        return "Creation Failed";
    }

when i look at incomingModel, the integer values return 0x0#####... I've been looking all over the forums but can't seem to find anything like this. Am i stuck sitting here converting each field to int?

chickenricekid
  • 390
  • 4
  • 19

1 Answers1

0

As Joe mentioned in the comment, it was just a silly debugger setting:

Visual Studio debugger - Displaying integer values in Hex

Community
  • 1
  • 1
chickenricekid
  • 390
  • 4
  • 19