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 348741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:23:35+00:00 2026-05-12T11:23:35+00:00

I am writing a web part against a list. The first thing I do

  • 0

I am writing a web part against a list. The first thing I do in the web part is verify that my custom event receivers are registered on the list. If they are not, I register the programmatically.

I have noticed that if I try to register an event that is already registered, I get no errors and no “Extra” events are registered.

My question is: Would it be more efficient to just register the events each time the web part loads rather than iterating through each event in the event receiver list and doing compares to see if each of my event receivers are there?

Edit

About the Property bag suggestions. After thinking a bit more about it, this will not be a feasable solution. The reason that I am “verifying” that the receivers are there is because we have 3rd party webparts that are attached to the same list. These have, in the past, actually unregistered our custom receivers. Setting a flag in the property bag will just let me know that I have verified once, but won’t tell me if they get removed by another.

  • 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-12T11:23:36+00:00Added an answer on May 12, 2026 at 11:23 am

    The code that SharePoint uses to update an event receiver collection is obfuscated, so there’s no way to know for sure. I would guess that the first step is a check similar to what you are doing manually. I’m inclined to go with what’s easiest until you identify that performance is an issue, in which case I would set a flag on the list’s RootFolder‘s property bag.

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

Sidebar

Related Questions

I'm writing a custom web part that extends DataFormWebPart. public class MyCustomWebPart : DataFormWebPart{
I'm writing a custom web part that is intended to be hosted in SharePoint.
I'm writing part of a web page that allows a user to build a
I am writing a SharePoint web part that interacts with a SQL database, allowing
I'm attempting to completely hide a custom web part I'm writing under specific circumstances.
SUMMARY: How to configure a web service such that writing to the Event Log
I'm writing a program that downloads information from the web and part of that
I have a two part question. First, I'm writing a web-scraper based on the
I am using Sharepoint 2007 and writing a web part. In the RenderContents method
I'm writing a simple web application in C# and I've gotten to the part

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.