.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

ItemAdded Event

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :SharePoint

Hi Everyone,

I would like to create a folder in List2 when item added in List1.

Can any one of you guide me how can I achieve this?

Let me know if you have any queires.




View Complete Post

More Related Resource Links

ItemAdded Event Handler not firing

Hi, I have created an ItemAdded Event handler that is linked to a content type. This event handler does certain custom validations and then sends Email to users. I have referenced this event handler in XML file as well but somehow the event handler is not getting fired...Following is the code.   Code Snippet            this.DisableEventFiring();            using (SPSite site = new SPSite(properties.SiteId))            {                 using (SPWeb web = site.OpenWeb())                {                    base.ItemAdding(properties);                     SPList nList = web.Lists["NList"];                    SPList IList = web.Lists["IList"];                     foreach (SPListItem listItem in nList.Items)                    {                        if (listItem["Topic"].ToString() == properties.ListItem["Topic"].ToString())                        {                            SPUser alertUser = (SPUser)(properties.ListItem["SUser"]);                            SPUtility.SendEmail(web, false, true,alertUser.Email,"New item added", "A new item has been added");                         }                    }                    this.EnableEventFiring();                }            }       The XML file is: Code Snippet  <XmlDocuments>      <XmlDocument NamespaceURI="http://schemas.microsoft.com/

ItemAdded event not getting fired

Hi, I have ItemAdded event created. I have added a function in that. The function counts the number of files in the subfoldes of the list. I have build the class file, and created it as a feature and activated the feature. I am not sure if my code is being hit. This is the code i have used. [CODE] namespace ItemCountEventHandler {     class Constants     {         public const string url = "Server Name";         public const string listname = "list name";     }     public class ItemCounting : SPItemEventReceiver     {         public override void ItemAdded(SPItemEventProperties properties)         {             //   base.ItemAdded(properties);             GetOpenItems();         }                   public static void GetOpenItems()         {             using (SPSite site = new SPSite(Constants.url))     

Event handler: properties.AfterProperties on a document library ItemUpdated/ItemAdded event


In a ItemUpdated event on a list i normally i use "properties.ListItem" to get data before the changes, and "properties.AfterProperties" to get data after the chages

But when working with document libraries things get a lot complicated. The ItemAdded handler gets called when a file is uploaded, not when the user specifies it's metadata. To handle these metadata i have to use the ItemUpdated handler.
But even there it happens that "properties.ListItem" and "properties.AfterProperties" result both null, so i cannot access any data i need

Is there a way to get a document metadata when it is added to a library?

ItemAdded Event not always returning SharePoint field information when InfoPath form submitted


 (SharePoint 2007)

I am struggling with an issue related to InfoPath and use of the ItemAdded event handler.  I have created an InfoPath form that contains several fields that are being published to SharePoint fields in a Forms Library.  When I submit a new form, the SharePoint data is being correctly updated.  ian see it in the list.  However, I am trying to write an ItemAdded event handler that performs specific logic based on the value of one of the InfoPath/SharePoint fields for the form being added to the library.  The logic appears to work correctly the first time through.  I can sucessfully read the value from the field and then execute my logic.  However, subsequent submissions appear to not be able to read the values.  It is like they don't exist or are null.  I am thinking that it has something to do with threading but I cannot find a work around for this problem.  The interesting thing is that the same exact logic works correctly when the ItemAdded event handler is tied to a standard Document Library.  Any word documents that are being added always read the values correctly. 


Does anybody know what might be causing this or a possible way around this issue? 



Radio Button Event

Here I have explained the events of radio button with javascript.
Let me explain the scenarion first,
We are having two radio button say radioobtn1 and radiobtn2. If I click on the button 1 then I need to show one DIVor FORM. same as when I click on radiobtn 2. I have given the code for the above scenarion.

how to impose javascript event processing?


If I have some form control like textbox and I want the event handler to be located in the html instead of at the server side, how to do that? Of course I can copy paste javascript code in the aspx file. But is it possible to do that using some object oriented approach (ie programmatically in the code behind)?


Dropdown Event (Template Field)



I have grid view control that includes a dropdown control in a template field.

I wish to execute some code when the value is changed in the dropdown list.  Can't figure out how to capture this event though?

Any suggestions?

Event ID 1011 - DefaultAppPool World Wid Web Pub. Serv. fatal communication error

We have a Windows 2003 server running IIS6 1.1 Framework. We have also installed a DNS and Active Directory in the same machine.

We're randomly getting the error you can see below. Sometimes it causes the recycling of process w3wp.exe (which on my understanding represents the application pool worker processd) and other times results on this process hanging and not responding to any request. To do iisrest temporarly solves the problem.

We were pointed to a possible permissions problem between the user we were runnig the DefaultAppPool with and registry entries used by the iis. We noticed the default predifined user we used, Network Service, wasn't found in the Active Directory, so we changed it by the default configurable user, IWAM_MACHINE_NAME, which is under the IIS_WPG Active Directory Grupo, which, in theory has the correct permissions to run the application pool.

Well, none of this worked and we are still getting this error.

This is driving us crazy and think the problem might have to do with having the Domain Controller/Active Directory and the IIS6 running on the same machine. We'll try now uninstalling this DC pointing to another one to see what happens.

Any help would be appreciated.

Thanks in advance,


Event Type: Warning

Event not raised while parsing xml file



In Visual Studio 2010 ASP.NET 4.0

I want to write a procedure to validate a xml file with a xsd. I found some examples on the web but the one i chose does not work as attended. The example uses XmlReader with a XmlReaderSettings and a ValidationEventHandler.

Here is the code

Protected Sub VerifyDes(ByVal filename As String)

        Dim xslDes As XmlReaderSettings = New XmlReaderSettings()
        xslDes.Schemas.Add("", "http://www.mysite.com/xsd/ValidData.xml")
        xslDes.ValidationType = ValidationType.Schema
        xslDes.ValidationFlags = XmlSchemaValidationFlags.ReportValidationWarnings

        AddHandler xslDes.ValidationEventHandler, AddressOf xslDesValidationEventHandler

        Dim des As XmlReader = XmlReader.Create(filename, xslDes)

        While (des.Read())

        End While

    End Sub

    Protected Sub xslDesValidationEventHandler(ByVal sender As Object, ByVal e As ValidationEventArgs)

        'some code here
    End Sub

I tested this procedure with a xml file which was well formed but contained some elements which were not conform to the xsd.

No event or error occured. It said the file was valid.

Then i tested with a badly formed file. A XmlException was raised but nothing happened with the ValidationEventHandler.

It seems lik

How to set up microsoft application blocks 4.0 to talk to event viewer


I need to set up the microsoft application blocks 4.0 on the server and connect it to my web project.  I need to set it up so that all the errors are logged in the event viewer.  So far I have found out how to set up a flat file listener and send the error to a log file but, not to the event viewer.  Any suggestions would be helpful.

    Composite control: How to bubble a textbox's TextChanged event?


    I've created a composite control that contains several controls, including a textbox. I'm trying to expose the TextChanged event of the textbox as an event on the composite control. I understand that events can be bubbled up the control hierarchy and handled at a higher level, which I've attempted to do, but I can't get the bubbled event to fire. When I drop the control on an aspx I can see the TextChanged event, I can subscribe to the event, but nothing ever happens. Any suggestions? Here is what I think is the relevant code:

    // My event
    private static readonly object EventTextChanged = new object();

    //Handle the bubbled event
    EventHandler textChangedHandler = (EventHandler)Events[EventTextChanged];
    protected override bool OnBubbleEvent(object source, EventArgs e) 
        bool handled = false;

    Reporting services in 2008 r2 how to get a report in a print button click event in my c#.net page


    how to  get a report in my c#.net page button lick event also steps to call a report from asp.net to reporting services


    Thanks in advance

    Creating Event Handler in Code behind


    Hi, so I have a control that is created in the code behind and generates fine but I can't figure out how to create an event handler for it.  I've found plenty of examples for it in C sharp, but none of them seem to apply to VB.  What I want to do is essentially this:

    myDropDownList.SelectedIndexChanged = "Event to do here"

    but it doesn't seem to work for me.

    Any suggestions are appreciated.

    Subscribing to .Net event from COM



    Can somebody tell me how to subscribe to .net event from the COM through interoperability?

    namespace EventSource
        public interface IBugEvents
            void Hungry();
            void Found(string item);
        public class Bug
            public delegate void HungryEventHandler();
            public delegate void FoundEventHandler(string item);
            public event HungryEventHandler Hungry;
            public event FoundEventHandler Found;

    Can somebody tell me how to Subscribe to the Hungry and Found events from the COM?If possible help me with COM Code.

    Event Tracing For Windows: Core Instrumentation Events in Windows 7, Part 2


    In Part 2, the authors cover core OS Event Tracing for Windows (ETW) events as well as present simple scripts to demonstrate a few basic accounting techniques on some of the OS events introduced.

    Alex Bendetov, Insung Park

    MSDN Magazine October 2009

    Event Tracing for Windows: Core Instrumentation Events in Windows 7


    In the first article of a two-part series, the authors present a high-level overview of the ETW technology and core OS instrumentation.

    Alex Bendetov, Insung Park

    MSDN Magazine September 2009

    Team System: Team Foundation Server Event Service


    Use the Team Foundation Server EventService to create and manage event subscriptions or create a Web service to receive and process events.

    Brian A. Randell

    MSDN Magazine May 2008

    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