我试图使用显示灯箱与逻辑是这样的图像:为什么我会收到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