DOM ELEMENT
<img id="userImage" src="" class="img-thumbnail" alt="New Company" />
javascript
function loadUserImage() {
$.ajax({
url: "@Url.Action("GetUserImageUrl","Account")",
dataType: "json",
type: "POST",
success: function (result) {
$("#userImage").attr('src', result);
}
});
}
function loadCompanyImage() {
$.ajax({
url: "@Url.Action("GetUserImageUrl","Account")",
dataType: "json",
type: "POST",
success: function (result) {
$("#companylogo").attr('src', result);
}
});
}
$(document).ready(loadUserImage); //Load User Image
MVC CONTROLLER ACTION
[HttpPost]
public JsonResult GetUserImageUrl()
{
return Json(SessionHelper.UserImageUrl);
}
No comments:
Post a Comment