Hi Developers,
In my project i have to Display a Base64 string as Image. We using ajax call jquery method to bind datas form WEBSERVICE.
I am having Base64 value in Db and Binding Image not displaying only displaying the raw data only.
1. My Cshtml Code
<img id="imgIDproof" src="@Url.Content("~/Content/img/Shared/NoImage.png")" alt="IDProof" style="max-width:200px;max-height:200px;">
2. Jquery Ajax Call Method
function GetCustomerKYCDetails() {
var myData =
{
MobileNumber: $("#txtMobileNumber").val()
}
$.ajax({
type: "POST",
url: pathIndex("CustomerDetails") + '/CustomerDetails/GetCustomerKYCDetails',
dataType: "json",
data: AddAntiForgeryToken(myData),
--- Success or Failure Response Here ---
if Success {
var outputid = document.getElementById('imgIDproof');
var extensionoutputid = list[0].Id_ProofImageExtension;
if (extensionoutputid.toUpperCase() == "PDF") {
outputid.src = pathIndex("KYCOperation") + "/Content/img/Shared/pdfimage.png";
}
else {
outputid.src = pathIndex("KYCOperation") + list[0].Id_ProofImagePath;
}
}
Kindly verify the codes which am using , if anyone know the solution kindly help me to done this task.
Sorry for brief code because i have tried a lot.
Thanks & Regards,
Paul.S