私はこのようなロジック何かをライトボックスを使用して画像を表示しようとしている: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
@ user1112006 - ページに画像を表示する場合は、「」タグをレンダリングします。また、ブラウザに送るテキストに '〜'構文を使用することはできません。サーバ側に置き換える必要があります。 –