At page 176 of the book there is an explanation on how to modify the
SiteHeader control to add user authentication to every page. The part of
code I have problems with is the following (amended):
SiteIdentity id =3D (SiteIdentity)Context.User.Identity;
As I work with VB.NET I translated the above code into the following
Dim currentUser As SiteIdentity =3D CType(Context.User.Identity,
When I test the page I get this error:
System.InvalidCastException: Specified cast is not valid.
I use Option Strict On on the page. I tried with Option Strict Off but I
still get the error.
Does anyone know how I can resolve this problem?