http://weblogs.asp.net/fredriknormen/archive/08/01/asp-net-mvc-3-0-preview-1-razor-and-nested-master-pages.aspx“rel=” Fredrik s Blog post, 如果发言,他就有一个C#的例子。
@if (WebSecurity.IsAuthenticated) {
<li><a href="/user/login">Log in</a></li>
} else {
<li><a href="/user/logout">Log out</a></li>
}
但是,在VB,我看不出如何做同样的事情。
@If (HttpContext.Current.User.Identity.IsAuthenticated) Then
<div id="dialog-confirm" title="Log Out">
<div class="alert" title="Alert">
</div>
Are you sure?</div>
End If
这表明,我的内部超文本标记是错误的。
基本情况如下:
@If (HttpContext.Current.User.Identity.IsAuthenticated) Then
End If
但是,如果声明被视为“编码”而不是“标识”,则其中的任何内容都属于此范畴。 我需要的是能够在那里打上标记。
是否有任何人知道,如果在拉扎尔·维博发表的话,如何做适当的发言?