我試圖使用顯示燈箱與邏輯是這樣的圖像:爲什麼我會收到Lightbox MVC剃鬚刀錯誤?
public ActionResult displayImg()
string lbx = "<a href=\"~/Content/Images/lighthouse.jpg\" rel=\"lightbox\"></a>";
return View (lbx);
但它給出了一個錯誤:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Illegal characters in path.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentException: Illegal characters in path.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
該代碼沒有任何意義。它也與剃刀無關。 – SLaks 2011-12-22 16:41:41
@ user1112006 - 如果要在頁面上顯示圖像,請呈現''標記。你也不能在發送給瀏覽器的文本中使用'〜'語法 - 它需要被替換爲服務器端。 – 2011-12-23 09:19:28