i am trying to display an image during my ajax call. I am using the jqueryform plugin. i cant seem to get the path right: i need the root path ,here is my code:
$(function () {
$("#ajaxUploadForm").ajaxForm({
iframe: true,
dataType: "json",
beforeSubmit: function () {
$("#ajaxUploadForm").block({ message: '<img src=' + '<%= @Url.Content("/Content/busy.gif") %>' + '/> Uploading Document...' });
},
success: function (result) {
$("#ajaxUploadForm").unblock();
$("#ajaxUploadForm").resetForm();
//$.growlUI(null, result.message);
if (result.message != 'Success') {
alert(result.message);
}
else {
}
},
error: function (xhr, textStatus, errorThrown) {
$("#ajaxUploadForm").unblock();
$("#ajaxUploadForm").resetForm();
}
});
});
Try like this:
Be careful though as if this is in a separate javascript file you will not be able to use helpers such as
Url.Content. Another possibility is to use CSS:and in your CSS file you could use relative paths (relative to the location of the CSS). Thus if you have a
~/Content/site.cssfile you could define the following rule: