Hi,
i am getting these 2 errors in the output window but everything works fine
Error 1 Keyword, identifier, or string expected after verbatim specifier: @
Error 2 A namespace cannot directly contain members such as fields or methods
here is my Helpers Page:
@using System.Security.Principal
@helper IfLoggedOn(Func<IPrincipal, HelperResult> content) {
var currentUser = HttpContext.Current.User;
if (currentUser == null) {
<i>
To use this content, you must
</i>
} else {
@content(currentUser)
}
}
thanks in advanced.
Comments: I received this same error when I had changed the Build Action on the "*.cshtml" file to "Compile". When I changed it to "None", the problem was resolved.
i am getting these 2 errors in the output window but everything works fine
Error 1 Keyword, identifier, or string expected after verbatim specifier: @
Error 2 A namespace cannot directly contain members such as fields or methods
here is my Helpers Page:
@using System.Security.Principal
@helper IfLoggedOn(Func<IPrincipal, HelperResult> content) {
var currentUser = HttpContext.Current.User;
if (currentUser == null) {
<i>
To use this content, you must
</i>
} else {
@content(currentUser)
}
}
thanks in advanced.
Comments: I received this same error when I had changed the Build Action on the "*.cshtml" file to "Compile". When I changed it to "None", the problem was resolved.