.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

EventReceivers firing on all custom lists

Posted By:      Posted Date: October 24, 2010    Points: 0   Category :SharePoint

Hi everyone, I've come here as a last resort before I find a revolver and a barn. I've struggled with this problem for weeks, even though it should in theory be a ridiciously simple thing.

My problem is that I have build a eventreceiver in VS2010 which for some reason is triggered on more lists than I specify. When I modifiy a list, the itemadding/added/updated/deleted-event is triggered for all the lists in the site. I don't have a clue why this happens, and I will provide code below. I have looked into the possibility that older versions/eventreceivers have been in action, hence I've deactivated all solutions and all, but a couple of integrated features. I've also started a new project in VS several times, and copied only the code over to the new project.

Obviously I've removed the ListTemplateId from the Receivers in the Elements.xml file. I should mention though, that my eventreceivers were still called even if I didn't assign them to any list in elements.xml, or if I specified ListUrl="myList" for example. The result is that the itemadding/added/updated/deleted-event is triggered for all the lists in the site.

My elements.xml file is as below:

<?xml version

View Complete Post

More Related Resource Links

List Event Receivers firing for all custom lists

Hello, I have a site with two custom lists, and I have created an EventReceiver class to handle the ItemAdded event for custom lists. I have modified the EventReceiver's Elements.xml file to only handle items added to one of the custom lists instead of all custom lists, by changing: <Receivers ListTemplateId="100"> to <Receivers ListUrl="/Lists/MyCustomList">   however, when debugging, the ItemAdded method is being fired when an item is added in both custom lists. I have had to work around this by checking within the ItemAdded method for the list that fired the event:        public override void ItemAdded(SPItemEventProperties properties)        {            base.ItemAdded(properties);            if (properties.ListTitle.Equals("My Custom List")) { ... } I thought the ListUrl attribute of the Receivers element specifies the event to only fire for the specific list with that url? (see http://msdn.microsoft.com/en-us/library/ms431081.aspx). Is there somewhere else I should be checking?   Thanks

Quick Note: Create Lists with Custom Content Types in SharePoint 2010

Learn how to create a list in SharePoint Server 2010 and associate it with a new content type. Next, you disassociate the list from the content type and then delete the list.

custom sharepoint lists programatically with the forms?

hi,     can any one give a link to a post for creating Sharepoint Lists from scratch. i would like to know about creating custom lists from scratch like the NewForm.aspx, EditForm.aspx,AllItems.aspx .  i know we can create list from OOTB but i would like to know using object model please help.

Unable to Customize Custom Lists. Sharepoint Error: User cannot be found.

I am not sure what the best way to put/describe my issue . I am unable to customize my custom list. Steps: 1. Login to sharepoint site. 2. Site Actions -> Site Settings 3. Under Site Administration -> Site Libraries and lists 4. Clicked on a custom list.   Error: Error User cannot be found.   Troubleshoot issues with Microsoft SharePoint Foundation. Correlation ID: 4063bf58-9cb7-4204-8cc4-cc2889abffe3 Date and Time: 9/9/2010 5:51:58 PM   I figured this may be an issue with site permissions, so I have went into site permissions and removed and re-added Administrator into Homeowners group.   Thank you in advance.   Howie

Custom masterpage Layout works fine, but WIDE sharepoint lists flow through, over design

Hello all, and thanks in advance for any help. We've built a custom masterpage layout and so far it works great.  We have specified a layout based on tables that fix the width at 960pixels.  The tables are centered on the screen and have a particular background that is different from the page's background to make the content pop.  It works fine in most cases and still displays all MOSSs dynamic contents like the quicklaunch bar at left, etc.  The theme sort of looks like this : http://www.sharepointpackages.com/index.php?main_page=product_info&cPath=65&products_id=268&zenid=a045f5b7dba91fdab94d754569e0b611 The problem is that when a list has too many columns and is therefore wider than the 700 or so pixels that are left over for the placeholders inside the table, the list continues on, but does not affect the table itself.  In other words it appears as if the content was placed OVER the tables in the layout.  This is odd first of all, but it is actually bad in a way, because even if I use styles on the table cells that hold these placeholders, and have the overflow use scrolls, the table ACTUALLY does not see an overflow and the contents continue to run through without activating the scrollbars (they don't even show up).  Can anyone help.  Please, Please, I've been looking at HTML for two days straight now trying to fi

Custom WebPart .LoadControl(.ascx) event not firing


I am creating a Webpart which loads a custom control (.ascx) in the CreateChildControls Event

        protected override void CreateChildControls(EventArgs e)

            _userControl = Page.LoadControl(@"/_controltemplates/ControlTemplates/CustomUserControl.ascx");
            _userControl.ID = "usrSearchResults";


In the codebehind of this user control (I am using the inherits model as in ASP.NET 1.1) I have an InitializeControls method which binds the eventhandlers to an already existing DropDownList on the user control.

Markup in the .ascx file
    <asp:DropDownList ID="ddlRegions" AutoPostBack="true" runat="server" DataTextField="Title"
        DataValueField="Title" EnableViewState="true">

EventHandling code in the code behind of the user control.  This code runs in every Page_Load event.

ddlRegions.DataBound += new EventHandler(ddlRegions_DataBound);
The problem is that when the selected values in the dropdownlist changes the event handler does not fire (a post does occur though).  Am I missing something here?


Sharepoint Foundation - Create and deploy custom edit/view forms for external lists


Firstly, we are using sharepoint foundation so Infopath forms are not an option for us.

We have a Visual Studio sharepoint project which deploys a complete sharepoint site. The site contains a number of external lists and we want to be able to create customised view/edit forms for these lists and add them to our Visual Studio project so they can be deployed as part of the new site. The idea is that we can deploy the solution to a fresh site with a default set of forms which can then be customised for different implementations of the site.

Here's the steps we have been using to try and do this:

1. Deploy the base project (BDC) to the sharepoint site

2. Create external lists based on the BDC content types

3. Use Sharepoint Designer to create new edit/view forms for the lists and set these as the default forms for the list

3. Save the site as a template

4. Import the template into a new Visual Studio project and select the lists we require. This gives us a List Definition, a pages module (with element file), an elements file and a schema file (both for the List Instance).

5. We then add the contents of the imported project to our main solution as follows:

  • Create a new List Definition (including List Instance)
  • Copy the contents of the imported Elements.xml to the Elements file for our List Instance.

.NET Interface to Create/Maintain Custom Lists in SSAS


I would like to create a .NET interface to Create and Maintain Custom Lists in SSAS Cubes.  Would anyone know if there are any source code projects going in this direction?? If not, some direction on how to accomplish this?  Anyone have existing code/samples to.. Ex. Create lists from MDX scripts wrapped in Stored procedures 

Any help would be greatly appreciated


kpi not showing up in Custom Lists

I'm not seeing KPIs showing under the custom lists. The site was setup as a Collaboration/Blank Site.

Removing "External List" option from Custom Lists?


We are in the process of upgrading from SharePoint 2007 to SharePoint 2010.  Our business users have noticed a new option of creating a new "External List" under the Custom Lists heading.  Is there any way to remove the External List option without having to customize the create.aspx page?

Andy Kreider | Principal Financial Group | Des Moines, IA, USA

Sharepoint Designer 2010 - How to add custom columns to lists



When creating a new view - I would like to add an extra column which I could use as a custom hyperlink to fire up the EditForm.aspx or my on custom ediform.  I would like it.  Is there a step by step that shows hwo to do wthis with SP 2010 and SPD 2010?

Thanks in advance



PreSaveAction is not firing for a custom save button on a Custom List Form

Hi Everybody,
I've created a custom list form using SPD. Now I want to put a custom button for saving and redirecting to another page based on a logic. I am using following script for making a custom Save button.

<input type="button" value="Submit" name="Submit" onclick="{ddwrt:GenFireServerEvent('__commit;__redirect={Confirm.aspx}')}  " />
When the user clicks this button, I am able to save the values, but the validation I have implemented in the PreSaveAction() is not getting activated. I don't understand where the problem is.

Is validation with PreSaveAction()  works only with OOB SaveButton ?

Thanks in advance,
- Loka Samastha Sukhino Bhavanthu : May Eternal Peace & Goodwill Prevail in the Whole World!

.Net custom user control buttons (events) not firing in Jquery Modal Popup


I have a custom control, that has takes some information from user and submit to the database. it is working fine in normal aspx pages. but when i display that custom user control in jQuery modal popup. The events does not fire or lets say the data is not submitted to the database.

any help on that?

Deploy Custom Lists



I have custom lists created in WSS 3.0 and also workflows created using Sharepoint designer 2007. I need to deploy this into production. I am new to sharepoint and I need some help in doing so.

What would be the best method for deployment? We did not use VS2005 / VS2008. I guess the deployment also should not use that.

After applying custom master page, "Current View" drop down is no longer functional on Lists


The "Current View" drop down is not dropping down anymore when on the list library ribbon with a custom master page applied. Of course, it does work fine with v4.master. I would list all the custom master page changes however they are numerous. So I am looking to see if there are any ribbon experts that can give me things to at least look for. I would really appreciate it! Thanks!

how to open custom lists schema via SharePoint Designer


Hi everybody,

I have a custom list, lets call it MyList (http://myserver/Lists/MyList/) with several fields in it.
I would like to open this lists schema (http://msdn.microsoft.com/en-us/library/aa543477.aspx).
I do not mean the the unghosted version in ...\14\TEMPLATE\FEATURES\CustomList folder, but to open the the schema for this particular list via SharePoint Designer. I do not see such a file when I open MyList folder with SPD...
Can anyone advice on this?

Thanks in advance!


Sharepoint Lists and Outlook Sync: Custom Lists Sync


Hello SharePoint Gurus,

I have been assigned this new task where I am required to integrate Microsoft Outlook with custom SharePoint site. Unlike a calendar or tasks list, I need to integrate contact information in the outlook contact directory. According to this post there is no provision to achieve this. But in case somebody out there guide me on this and let me know a possibility which can facilitate me in this regard.

Looking forward to hear from you guys.


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend