Narasimha p

Narasimha p

  • NA
  • 62
  • 10k

how to bind data fileupload control use database in mvc 5 with ajax(co

Jul 29 2020 11:54 PM
<input type="file" id="file" class="form-control" name="postedFiles" />
<input type="submit" class="btn btn-primary" value="GetDetail" id="btnGetDetails" />
$('#btnGetDetails').click(function(){
var tr = $(lnk).closest('tr');
var Id = $(tr).find('td').eq(1).html();
$.ajax({
url: "/Home/Index",
type: "GET",
data: { 'GetId': Id },
contentType: "application/json;charset=UTF-8",
dataType: "json",
success: function (result) {
$('#file').attr(result.photoPath);
alert(result.photoPath)
},
});
});
 

Answers (2)