1
将图片添加到字符串我使用asp.net MVC3剃刀块这样创建的字符串:使用剃刀代码块
@{
var closingMsg = "Thank you. Your dispute has been submitted to your Creditor for review. You will receive an email alert on Creditors response.";
}
我想它添加图像,我做了这样的:
@{
var closingMsg = "Thank you. Your dispute has been submitted to your Creditor for review. You will receive an email alert on Creditors response.'<img src='@Url.Content('~/Content/CR/images/sms-auth.png')' style='float: left; display:block; margin-right:6px;' alt='SMS text verification'/>'";
}
但它不显示图像。相反,它将其显示为字符串。我该如何改变它?
I am using it in Jquery UI like this:
function CloseDisputeDialog() {
$("#dispute_form").html("@closingMsg");
$("#dispute_form").dialog("addbutton", "Close", function() {
$("#dispute_res").val("close");
$("#dispute_form").dialog("close");
});
}
问候, 阿西夫·哈米德
我加入它是如何在jQuery中使用。请参阅更新的问题。谢谢 – DotnetSparrow
DotnetSparrow - 仍然,用@ Html.Raw(closingMsg)替换@closingMsg应该可以工作。所以把$(“#dispute_form”)。html(“@ Html.Raw(closingMsg)”); –
我用过,但它没有显示图像。可能是我需要给相对路径? – DotnetSparrow