To simplify a little, this is what my problem is:
I have a Masterpage that holds a button (defined on the master page) that I want to appear on every page on the site. This button should be enabled if the user is logged in and disabled if the user is not logged in, i.e. "my account" that does stuff for a logged in user.
I've tried two ways:
1) User info in the master page
On a content page one can use the function User.Identity.IsAuthenticated which returns true if the user is logged in. This can not be used on the master page because "User" is not defined. Error correction options from the IDE says I should import "Microsoft.VisualBasic.ApplicationServices", doing so just gives a new error since "Identity" is not a member of the import.
2) Accessing the maste page button from a content page.
On the master page the button is named btnMyAccount. I would like to do somthing like MasterPage.btnMyAccount.Enabled = User.Identity.IsAuthenticated on the content page but that does not work.
This post has been edited by jens: 23 November 2009 - 08:09 AM