SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a custom person.aspx that is currently used by my mysite application and I wrote a code that checks if the ProfilePropertyLoader control returns a null value of the profile page being viewed and redirects it to a page, but something is wrong because I keep getting the User Not Found error and the page does not redirect. It seems that the loading of the ProfilePropertyLoader is being executed first before the Page_Load. I have also tried on Init and PreRender but it does not change the result. :)

        public void Page_Load(object sender, EventArgs e){
                        UserProfile thisPageUserProfile = ProfilePropertyLoader.GetPageProfile(this.Page);

                         if(thisPageUserProfile == null){
                    catch(Exception ex)

thanks for the help in advance.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.