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