I know what visual basic is that wasn't even the question.
here is the fix for the problem i found, and it works
If you want to avoid having to put the line "base.PhilePage_Load(sender, e) in your derived page's On_Load event, then instead take the code for replacing the context.user with the custom SitePrincipal object out of the PhilePage_Load method, and create a new method in the base page such as PhilePage_LoadUser. Then, in the base page OnInit method, change it to read:
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.PhilePage_LoadUser();
this.Error += new System.EventHandler(this.PhilePage_Error);
}
Now your derived page will execute and you can use the code in MyAccount.aspx exactly as is, and it will correctly pull the role info from the SitePrincipal and display it without any errors about invalid casts.
Woo hoo!
|