我有以这种方式呈现的以下图像。
<img src="../../../..@Model.FloorPlan.Floor_Plan_Image_Path@Model.FloorPlan.Floor_Plan_Image_Filename" alt=""/>
如果可能的话,我希望它的 src 属性将更改为 Url.Content。
我尝试过的是这个,但我的问题是将我的模型视为字符串:
<img src="@Url.Content("~/Model.FloorPlan.Floor_Plan_Image_Path@Model.FloorPlan.Floor_Plan_Image_Filename")" alt=""/>
谁能帮我?
Path 和 Filename 的值如下:
Model.FloorPlan.Floor_Plan_Image_Path = "/Content/Uploads/FloorPlans/00004601/" Model.FloorPlan.Floor_Plan_Image_Filename = "testfloorplan.png"