私のコントローラーの場合:
public ActionResult Index()
{
//no code implied
return View;
}
次に、返されるビューで:
<%if(ViewData["SomeString"].ToString() != "True") {%> show this <%}%>
オブジェクト参照にオブジェクトがないため、実行時にエラーが発生します。
ただし、私が行うページ内:
<%if(Request.QueryString["Something"].ToString() != "True") {%> show this <%}%>
更新:実際にエラーが発生します。
編集: 結局、彼らは同じように振る舞うように見えます.