Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6745321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:11:26+00:00 2026-05-26T12:11:26+00:00

I have a SharePoint 2010 MySites set up on its own web application. There

  • 0

I have a SharePoint 2010 MySites set up on its own web application. There is the standard site collection at the base level, http://site:80/.

The personal sites for each user is at the managed URL /personal/.

I have a working event handler which add items to the Newsfeed when a user adds something to a picture library.

THE PROBLEM:
The problem is, this only works if they add to a picture library at the base site collection, http://site:80/, and does NOT work if they add to http://site:80/personal/last first/.

Does anyone know why? The event handler feature is site scoped and my understanding is that it should work on all subsites.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:11:26+00:00Added an answer on May 26, 2026 at 12:11 pm

    Ok. Because you can only ‘staple’ features to site definitions which will be provisioned in the future, you need a way to activate new features on existing sites.

    So, the fix I discovered and used follows:

    The default page for the newsfeed is http://site:80/default.aspx. If you create an event receiver and scope it for ‘site’ and deploy it globally or to that web application, then it will work on the base site collection. Each personal site is a site collection and has the feature but it needs to be activated on each personal site collection.

    So, in the default.aspx page, you place the following which will activate the feature if it has not yet been activated.

    <script runat="server" type="text/c#">
    protected override void OnLoad(EventArgs e) {
      base.OnLoad(e);
    
      String sAccount = (((SPWeb)((SPSite)SPContext.Current.Site).OpenWeb()).CurrentUser.LoginName).Split('\\')[1];
      String basePersonalURL = "http://site:80/personal/";
      String eventReceiverFeatureId = "12345678-1234-1234-1234-1234567890ab";
    
      using(SPSite site = new SPSite(basePersonalURL + sAccount)) {
        site.AllowUnsafeUpdates = true;
        using(SPWeb web = site.RootWeb) {
          web.AllowUnsafeUpdates = true;
    
          try { site.Features.Add(new Guid(eventReceiverFeatureId)); } catch {}
    
          web.AllowUnsafeUpdates = false;
        }
        site.AllowUnsafeUpdates = false;
      }
    }
    </script>
    

    You also need to edit the web.config file in order to allow inline code to run for this page. Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Sharepoint 2010 site with a Silverlight web part. When someone comes
I have a Java client that consumes SharePoint 2010 standard web services (sitedata.asmx, permissions.asmx,
I have configured FBA on Sharepoint 2010 site. And its working fine when I
I have a SharePoint 2010 web application that I'd like to use a custom
I have been investigating building web parts for sharepoint 2010 and currently have a
I have my Sharepoint Server 2010 set-up and everything appears to be functioning correctly.
In SharePoint 2010 I have a visual web part that uses SP.UI.ModalDialog.showModalDialog The dialog
We are currently using TFS 2010 and have a Team site of SharePoint 2007.
I have Web page in share-point 2010 ,its has two web parts one for
SharePoint 2010 I have an enterprise wiki site, that I exported and imported from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.