簡體   English   中英

如何在asp.net mvc項目中設置和更改圖像?

[英]How to set and change the image in asp.net mvc project?

我有一個內置於asp.net mvc中的網頁,在該網頁中我不確定如何將圖像(下面的屏幕快照中所示的藍色圓圈中標記的which is a square box left to Basic text )更改為另一圖像。 屬於該圖像的代碼是:

cols.Bound(e => e.EleNum)
       .HeaderTemplate("<img id='btnEleExpandCollapse' src='" + @Url.Content("~/images/icon/ec-expand.png") + "' alt=\"" + @rsc_rating_Index.action_criteria_expand + "\" title=\"" + @rsc_rating_Index.action_criteria_expand + "\" class='btnImgNobg tooltip' style='width:30px;height:30px;visibility:visible;' />")
       .HeaderHtmlAttributes(new { @class = "grd-center grd-valign-mdl", @style = "border-left-width:0px;" })
       .ClientTemplate("<img id='imgEleLevel#:EleID#' src='" + @Url.Content("#:EleLevelImageLocation#") + "' alt=\"" + "#:EleLevelText#" + "\" title=\"" + "#:EleLevelText#" + "\" class='tooltip' style='width:24px;height:24px;' />")
       .HtmlAttributes(new { @class = "grd-center", @style = "width:40px;" });



隨附上面代碼的網頁截圖。 我想知道how to remove the text Basic and a square box image marked in blue circle從上述代碼中how to remove the text Basic and a square box image marked in blue circle 進行檢查時,以下行涵蓋了基本文本和方形圖像,如下所示。

.ClientTemplate("<img id='imgEleLevel#:EleID#' src='" + @Url.Content("#:EleLevelImageLocation#") + "' alt=\"" + "#:EleLevelText#" + "\" title=\"" + "#:EleLevelText#" + "\" class='tooltip' style='width:24px;height:24px;' />")


在此處輸入圖片說明


我感覺需要在下一行中進行更改,但是我不確定確切的位置和方式。 任何對此的指針將不勝感激。

.ClientTemplate("<img id='imgEleLevel#:EleID#' src='" + @Url.Content("#:EleLevelImageLocation#") + "' alt=\"" + "#:EleLevelText#" + "\" title=\"" + "#:EleLevelText#" + "\" class='tooltip' style='width:24px;height:24px;' />")

你可以試試這個

.ClientTemplate("<img id='imgEleLevel#=EleID#' src='" + @Url.Content("#= Proposal_ID #") + "' alt=\"" + "#=EleLevelText#" + "\" title=\"" + "#=EleLevelText#" + "\" class='tooltip' style='width:24px;height:24px;' />")

我希望它將為您工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM