我選擇通過一些我繼承的C#代碼,並嘗試在鏈接中顯示圖像的方式;這是行的工作,並顯示的形象,但我需要包裝這在一個鏈接。Response.write在一個HTML元素c#
Response.Write(Html.PropImage(item.MainImage.ImageUrl095, item.AccomName));
後來我發現在那裏是一個鏈接元素,所以我想我可以複製這個(因爲它是正確的鏈接,我需要),將其套在HTML.PropImage line.Like這
Html.PropRefLink(item.AreaName, item.AccomName, item.AccomCode, Html.PropImage(item.MainImage.ImageUrl095, item.AccomName), (string)ViewData["PDate"], (string)ViewData["PDuration"], (string)ViewData["PSleeps"]);
我刪除了response.write,因爲它打破了頁面,我該如何在鏈接中呈現html.propimage?
感謝
這是原單我採取的鏈接聲明; (string)ViewData [「PDate」],(string)ViewData [「PDuration」],(字符串) ViewData [「PSleeps」])%> – ivor 2009-11-09 12:55:01
Html.PropImage和PropRefLink不是框架方法,所以我們可能很難理解這裏發生了什麼或者這些方法的行爲。此外,這是簡單的asp.net或是mvc? – Will 2009-11-09 12:55:45
公共靜態字符串PropRefLink(這個HtmlHelper的HTML,字符串areaName,字符串的宴會名稱,字符串accomCode,字符串linktext,字符串日期,字符串持續時間,字符串睡眠) – ivor 2009-11-09 12:57:28