Gnanavel Sekar

Gnanavel Sekar

  • NA
  • 8.4k
  • 7.3m

Map the image path in jquery

Mar 3 2017 2:44 AM
Hi pal,
I have more than one project in one solution, am just displaying the image from folder but that folder exist in another project but in same solution. 
 Just assume i have one project called Themes and another one orchard.web
 
this below script exists in themes project and image exists in orchard.web project..
the themes project is common for all layout that's why am here using. the images all exist under ~/UploadFiles/ folder.
 
$.ajax({
url: crudServiceBaseUrl,
data: { UserId: UD },
type: "Get",
dataType: 'json',
contentType: 'application/json; charset=utf-8',
success: function (result) {
if (result.ContactImg != null) {
----->here i want to assign the image to that image control 
$(".Imgchange").attr('src', '~/UploadFiles/' + result.ContactImg.split('.')[0] + "_" + UD + result.ContactImg.split('.')[1]);
}
else {
$(".Imgchange").attr('src', '/OrchardLocal/Themes/Gentelella/Content/Images/img.jpg');
---->it's working fine due to in same project as well as it's static 
}
}
});
 
Thanks in advance
 
 
 
 

Answers (4)