In the current script, it $(this)refers to an object Window(not your button) that does not have an attribute data-, therefore its undefined.
This can be solved by passing a function element.
<button data-assigned-id="@IdUser" onclick="updateClick(this)" type="button" ... ></button>
function updateClick(element) {
var id = $(element).data('assigned-id');
....
Javascript, .
<button data-assigned-id="@IdUser" id="mybutton" type="button" class="btn btn-sm btn-default"></button>
$('#mybutton').click(function() {
var id = $(this).data('assigned-id');
....
});