.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

event handler - how to add item from listA in SiteA to listB in SiteB

Posted By:      Posted Date: September 22, 2010    Points: 0   Category :SharePoint

hi..is there a way to add items from one list to another..


View Complete Post

More Related Resource Links

how to get values of list item being entered in ItemAdding event handler?

Hi,          i am trying to get the values being entered in a listitem in the ItemAdding eventhandler as follows, but it doesnt work. public override void ItemAdding(SPItemEventProperties properties)         {             base.ItemAdding(properties);             SPSite CurrentSite = new SPSite("http://mm-moss/np/");             SPWeb CurrentWeb = properties.OpenWeb();             SPList CurrentList = CurrentWeb.Lists[properties.ListId];             string vehicleNo = CurrentList.Items[CurrentList.Items.Count - 1]["Vehicle No"].ToString();             string  name=CurrentList.Items[CurrentList.Items.Count-1]["Name"].ToString(); } when i debug i cant get hold of the VehicleNo value. canyone help me in getting the values of the list item being entered? Thank you all.

New item insertion validation through event handler

My requirement is.... I have a list in SharePoint 2007. When I will add a new item into that list it will check the with the previous list item in the list (only title column). If the  same is available it should not allow to insert in the list and cutom error should through. If the same title name is not in the list it should insert in the list. As far my knowledge it will be done by event receiver. But I am unable to do it. Plaese help me....... Thanks in advance Rajesh.

event handler - item adding and updating..example



I am a beginner to event handlers..I need to create something like..items created in List A should appear in List B, and when it is updated, it should appear in List B as well..are there like free samples that I can work on..I am not really good at programming

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.

want to launch modal Popup from created User Event handler




I have a create user wizard on my page and in the event handler (Created User) I get extra information from the user

via textboxes within the aspx etc.


I then do a response.redirect to another page.

What I want to happen is this


When the CreatedUser Event is fired, I  want a Modal Popup to show up with a message Processing your registration.

once the registration code is processed it will close and the users get redirected.


On my ASPX I have the Modal PopUp and a Panel.

In the code behind in the handler I put ModalPop.show()


but this does not work.


thanks for any suggestions



InfoPath Workflow Task Form "Loading" event handler only being called after App Pool recycled.


I have a Workflow that is using an InfoPath task form.  In the "FormEvents_Loading" method event handler I have some code that needs to run each time the form is opened.   I recycle the App Pool and open the form the code runs perfectly, but if I close and try to re-open the form the code is not run at all.  I can then recycle the App Pool again and on the next load the code executes just fine.   The code that is supposed to be run is a very simple statement to set a field value, so I don't think it is interfering.

Does anyone know what this might be?


Event Handler Credentials


I made EH that checks out document when OOB Approval WF is finished successfully.

I want doc to be checked out by WF Initiator, but by default it is made by System Account.

How can i change Event Handler Account ?

How to pre-populate field values of ListB from ListA


I want to know if there is an easy way to the pre-populate field values to ListB from ListA. 

In ListA I have ColumnA, ColumnB and ColumnC.  In ListB, I have Column1, Column2 and Column3.

When I add a new item in ListB, Column1 is a lookup field tied to ColumnA.  So, if I select a value from the lookup list, I want it to automatically populate ColumnB value to Column2 and ColumnC value to Column3.  Can this be done without programming?

Pre_Init event handler problem


Hi all my friends

   I have to masterpages for my home page.

1. The first is for the annonymous users which has the login controls. its name is General_Anonymous.master.

2. The second one is for the logged in users which has a logout button and it hasn't the login controls in it. its name is General_LoggedIn.master.

in my default.aspx page I wrote the following code

protected void Page_PreInit(object sender, EventArgs e)
            if (Session["SupId"] == null && Session["CustomerId"] == null)
                this.MasterPageFile = "~/Masters/General_Anonymous.master";
                this.MasterPageFile = "~/Masters/General_LoggedIn.master";

Event Handler & AD

My event handler is working fine until i add AD part. After this string it stops firing at all: DirectoryEntry dom = new DirectoryEntry(); I mean it compiles, deploys and doesnt react to anything ( Why ? PS VS2010, SP2010  

listview with button in item template - how do I handle the click event?

Hello,Using a listview control for the first time... I need a button for each item, and of course I need to handle the click event for the buttons... upon clicking a particular button I of course need to know which item the button is associated with so the appropriate action can be taken...In VS, I can't select the button and see my list of available events in the properties window like is normally done for controls outside of templates like this... what do I need to do?

Create a meeting instance with an event handler

Hi, i want to know if its posible to insert a new meeting instance in a meeting workspace automatically when you add a new event in a calendar.   i try to pass automatically the option of the template selection.   its posible with the objetc model or web services?   thanks

Event handler that will take an e-mail sent to a doc library and save it as an .MSG file within the

Hi All, I have a requirement to create an event handler that will take an e-mail sent to a doc library and save it as an .MSG file within the library? Any help/inputs on getting this done is much appreciated.  Hanif

Sharepoint Event Handler not firing

I have written an event handler for an ItemAdded eventfor a document library. I am trying to read an excel file being uploaded and extract a value from it which I write to a list column for the item. I have this working properly on my development machine which is a Windows Server 2003 machine.However, on a production Windows Server 2008 machine, the event handler never fires. I am doing a simple write to a log file to test and see if it runs at all even if the Excel parsing does not work but I get no indication that it ran. The event handler is being registered with a feature that I am deploying. I have verified that the event handler is registered to the library by using the u2u Event Handler Explorer tool.Is there any way I can determine if my event handlers are even executing? How can I debug this?

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/

Event Handler not picking up error

I have a connection manager which uses a Variable as part of a ConnectionString. I have tried putting an Event handler on the package to capture any errors with the connection string. Unfortunately the event handler does not pick up any errors. I would like to add some screenshot but i am not sure how to do it on this forum.  Mr Shaw

Event handler to delete minor versions in document libraries

Hi Is there a way we can capture the deletion of minor versions in document libraries using any event handler. May not be using the delete all the minor versions but at least when we use the option to delete the selected minor version. I do not see the ItemUpdating and ItemUpdated getting fired in this case. Thanks wpwije  
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