次のコードを使用するWeb上のいくつかの例を読みました。
Private Function SomeFunction(ByVal htmlhelper As HtmlHelper) As String
Dim controller As Controller = htmlhelper.ViewContext.Controller
If controller IsNot Nothing Then
Dim vname as String = htmlhelper.ViewContext.ViewName 'This doesnt work
End If
End Function
ViewContextには、ViewNameというメンバーがありません。私は何かが足りないのですか?
参照:
http://blog.eworldui.net/post/2008/05/ASPNET-MVC---Localization.aspx Asp.Net MVC:現在特定のビューhttp://groups
を使用しているかどうかを判断する方法。
google.com/group/spark-dev/browse_thread/thread/e5d9e8264c66ba57