Home » C# Programming

Event Handler for Survey list is not working


I have written a event handler, but it is not getting triggered for survey type list.

Is there any specific steps need to be performed for event handler with survey list.


Thanks in advance.



4 Answers Found


Answer 1

Can you describe how you attach your event handler please? There should not be anything special.



Answer 2

Hi jeroen,

I have attach it in following way.

1. Develop event handler solution in VS 2008.

2. The event handler class is written in following way. 

class Survey_EventItemEventReceiver : SPItemEventReceiver


Name of of survey list handled by extracting the list name using "properties.ListTitle.ToString()"  in the ItemAdding() 3. Deployed the event handler using deploy from Build menu available in VS Studio 2008.




Answer 3

Hi bdnp,

Thanks to share your problem with us.

You can also share your code with us so it will be easy to find the problem


Answer 4

And how exactly do you attach your Survey_EventItemEventReceiver to your Survey List? That's the part I'm looking for.
Feature activation? Console application? Some other way? Please elaborate




when am copying a date column from list A to List B.

am able to copy the the date but, copied date has date decreased by a day!



List A


Date= 11\26\2010


after coping to

List B


Date = 11\25\2010


any thoughts?

 DateTime dt;
            if (properties.AfterProperties["follow_x0020_Date"] != null)

                item["Status follow up date"] = properties.AfterProperties["follow_x0020_Date"].ToString();
                flag = 1;
                dt = Convert.ToDateTime(properties.ListItem["follow_x0020_Date"]);
                item["Status follow up date"] = dt;


Thanks in advance!



Will COM Add-in event handlers conflict with Word macro event handlers? I have a Word 2003 template with the Document_New() and Document_Open() event handlers. I open this template with Word 2007. When the Adobe PDFMaker COM Add-in or the SearchCommand Add-in is enabled, the Document_New() or Open() events never fire. It appears that they are wiped out by the COM Add-in or the add-ins prevents the template from loading correctly. I say this, because looking in the VBA code only shows the macros from the COM Add-Ins. The COM Add-in macros are event handlers including Initialize() and several different CompileNow() event handlers.

If they do conflict, is there a way to cause the Word macro event handler to be in effect and exclude the add-in event handler?

Thanks in advance for any help,


Enjoy your day, Joe

Dear Friends

I have a list with a dropdown Also i have an Event handler on that list.

ON UPDATING, I want to check if the value in the dropdown was changed or not,

When i use

properties.ListItem["MyDropDown"] == 
this gives me the value from Database (already saved). But i want to get the current value/status of DROPDOWN.

How can i do that

Please help

Kind regards


Dear Friends

I want to Disable the OK Button in my Event Handler when some one try to edit the item in my LIST (OK button which saves the changing). I will check for some condition and if true the OK BUTTON will be disabled. How can i do that in List Event Handler. I am sure this check will be performed at the Load or init stage.

Is it possible?

Kind regards


How can I add a event receiver handler to an specific list?

I saw that but I don't know how to use that:




I wonder what are these empty event handlers that swarm in Task Lists with IDs 32767 ?

I think they can be a reason why my Announcements dont work from such lists. And wf dont autostart also (autostart on creation).


In dynamic dropdown list ,

i created and fill the data from that i selecte one item.See the following code.

protected override void OnInit(EventArgs e)

        DataTable dt = new DataTable();

        dt = db.Fill("L");

        DropDownList ddl = new DropDownList();

        ddl.Style["position"] = "Absolute";
        ddl.Style["Top"] = "225px";
        ddl.Style["Left"] = "100px";
        ddl.AutoPostBack = true;
        ddl.SelectedIndexChanged += new EventHandler(ddl_SelectedIndexChanged);

        ddl.DataSource = dt;
        ddl.DataTextField = "Deslist";

protected void ddl_SelectedIndexChanged(object sender, EventArgs e)
            DropDownList ddlName = new DropDownList();
            ddlName = (DropDownList)sender;
            string name = ddlName.SelectedItem.Text.ToString();
            DataTable dt = new DataTable();

            dt = db.Fill(name);

            ddlName.Style["position"] = "Absolute";
            ddlName.Style["Top"] = "325px";
            ddlName.Style["Left"] = "100px";
            ddlName.DataSource = dt;
            ddlName.DataTextField = "Name";

        catch (SqlException ex)
            throw ex;

the above code work properly. but issue is when  event(ddl_SelectedIndexChanged) occure.

ddl - dropdownlist is not view in the screen.How can shown the both dropdownlist.






I am trying to bind an event handler to a list using the following code. I have the same code before with success, but I am not sure why it is not binding it anymore. Also I am getting no error, but the event is not firing when I bind the event handler using the following code:


staticvoid Main(string[] args)
      int check = 1;
        SPSite collection = new SPSite("https://fullsitepathhere");
        Console.WriteLine("Working - 1");
        check = 3;
        SPWeb site = collection.OpenWeb();
        Console.WriteLine("Working - 2");
        check = 4;
        SPList temp = site.Lists["Data Storage"];
        Console.WriteLine("Working - 3");
        check = 2;

        string assname = "NewSaas, Version=, Culture=neutral, PublicKeyToken=038de5f4e8f782c2";
        string classname = "NewSaas.saasNew";

        temp.EventReceivers.Add(SPEventReceiverType.ItemAdded, assname, classname);
        Console.WriteLine("Working - 4");
        temp.EventReceivers.Add(SPEventReceiverType.ItemUpdated, assname, classname);
      catch (Exception ex)
        Console.WriteLine("Encountered this - " + ex.ToString() + " --> " + check.ToString());
Any suggestions???


Hi all,

I am new to CRM 4.0 and would like to do some customization to it.

Can anyone share on the following:

How to add additional handlers for the event. So far there is only a default onChange shown in the eventlist, but no means to add other handlers. By default, there is only a maximum of 4 columns to be created for a section. Any way to create more columns?

Please advise.



hi ;

i would like to ask if i can use event handler with external list(BCS) in SharePoint 2010

like custom list.


i create external content type for table in sql through sharepoint designer then i connect the external list to this content type

now i  need  to create event handler to handle the validation for external list however i investigated few of blogs that said event handler not support the external list is this true ?  





Best Regards



Hi All!

I tried the described sample on


with VS2010 and Excel 2007 using the Excel Workbook template and the Excel Template template from Visual Studio but neither the here explained subroutine:

Private Sub Sheet1_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
Dim nr As Microsoft.Office.Tools.Excel.NamedRange = _
Me.Controls.AddNamedRange(Me.Range("A2"), "NamedRange1")
nr.Value2 = "This text was added by using code"
End Sub

Example worked nor any other action/ event handler I created for the Workbook or Excel template.

What did I forget? What is not explained in this example but necessary so that event handlers work?

Thank you!




First of all, sorry for my english, i'm french.

So, i made a winforms application where i use a reportviewer control to display reports stored in a Reporting Services Server. Few reports are linked.

My problem is that i can't navigate to a linked report clicking on the top left logo on a report. If i display this report on a web browser, the hyperlink on the logo is enabled.

Could you say me why the link is disabled ?

Thanks a lot.




I have a Document Library, In that when I am Uploading a file my SPEventReceiverType.Itemadded is working,but its not working when again am uploading the same file.

ie, I Have a file in document Library say "Test.pdf". If I tried to upload a file with same "Test.pdf", my event is not firing...

Please give me a solution for this..





I have created an event handler for Site Pages library in SharePoint 2010. In event Handler I have given the list template id (119 - wiki web page library) but the event handler is not working. Do I need to use different list template id for this.?


Hi All,

I have added a server event handler on CubeBuilt with all proper and valid information. When I build a new cube to fire this event and check the o/p I get following errors in Cube Build Tracking and it doesnt fire:

===== Verifying and running post-build server event handler =====

[1/5/2011 10:00 AM] Verifying and running post-build server event handler

[1/5/2011 10:01 AM] The OLAP post-build server event handler failed

===== Processing OLAP database =====

[1/5/2011 10:01 AM] Process OLAP database session started

[1/5/2011 10:01 AM] Analysis Services session started

[1/5/2011 10:03 AM] Analysis Services session completed successfully

===== Verifying and running post-process server event handler =====

[1/5/2011 10:03 AM] Verifying and running post-process server event handler

[1/5/2011 10:03 AM] The OLAP post-process server event handler failed

===== Process Completed =====

[1/5/2011 10:03 AM] Cube build request completed successfully.

01/05/2011 10:00:42.08  Microsoft.Office.Project.Server (0x0BE4) 0x0BB8 Project Server                 Project Server Analysis Cube Bu 8swo Medium   PWA:http://mytest/PWA, SSP:SharedServices_ORG, User:DOMAIN\102345, PSI:   [CBS] Status message: The OLAP post-build server event handler failed d72e1b52-af48-455b-bb5e-304c2a6b350f

01/05/2011 10:02:44.64  Microsoft.Office.Project.Server (0x0BE4) 0x0BB8 Project Server                 Project Server Analysis Cube Bu 8swo Medium   PWA:http://mytest/PWA, SSP:SharedServices_ORG, User:DOMAIN\102345, PSI:   [CBS] Status message: The OLAP post-process server event handler failed d72e1b52-af48-455b-bb5e-304c2a6b350f

Can you please help me out to rectify this issue.

Many thanks.

Mohsin Raza

I have a simple data flow task in my package and want to implement a OnError event handler on the DFT. In event handler I have only one execute sql task to insert a record in temp table.
My event handler never never never neever get executed... I tried all options from MSDN forums...

There are no errors in my data flow task.
DisableEventHandlers property of DFT is set to false.

Now I am only concerned about any installation problems...
I am using Visual Studio 2008 , .Net Framework3.5 SP1
SQL server 2008

Please help...


The following article talks about the conditions that have to be met for Application.Current.Install() to work but I was just wondering if I can have an event handler that gets executed from a user-initiated event that implements a parameter other than RoutedEventArgs. Did someone has try that already and get it to work?



Hi all, I created two event handler for testing purpose, doc lib and discussion event handler sperated into 2 project in SPTest solution.

I added 3rd project named "BulkDeploymentTest1", and created a new feature to associate above two features in "Web" scope.

Before the solution package deployment test, I clicked "Deploy" on "BulkDeploymentTest1" project, it can capture events correctly.

After I retrscted the program and clicked "package" and "WSP" file generated, I deployed a solution by MOSS 10 management shell:

Add-SPSolution -LiteralPath E:\SPTest.test.wsp

Install-SPSolution -Identity test.wsp -GACDeployment -Force

Finally, I activated the feature in the test site in manage site feature page.

In the re-test, I cannot capture the doc lib and discussion event, could you please advise me how can I fix this issue?

Thank you very much. 

The testing solution uploaded to http://www.4shared.com/file/zwSWDSFa/SPTestTest.html, please take a look if further information is required.



Please, I need to create surveies in one list with more options not like the one bulit in sharepoint 2007.  Please i need the best practice.




I need to determine when a user cancels a print job so I've set up the following code

printDoc.EndPrint += new PrintEventHandler(OnPrintEnded);

The function OnPrintEnded is as follows:

void OnPrintEnded(object sender, System.Drawing.Printing.PrintEventArgs e)

      if (e.Cancel == true)
        //tell the user it was cancelled

the problem is e.Cancel never gets set to true even when the user cancels the print by pressing the cancel button and the print job gets cancelled from the printer.

Does anyone know why?




<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure