Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

Changing Title when Adding a Page (Event Receiver)

$
0
0

Hello everyone,

I've just created an Event Receiver as explained on all the sites on the Internet. So I created a new projekt with an Event Receiver for "ItemAdding" on my Page Library inside my Enterprise Wiki. I want to change the Title when a new Page is created. When a new Item gets created he jumps right into my Visual Studio Debugger. So it gets fired! That works fine! But he doesn't change anything! There is no Exception! He just runs over my code but I can't see any changes afterwards. This is the code:

/// <summary>
/// An item is being added.
/// </summary>
public override void ItemAdding(SPItemEventProperties properties)
{
            properties.AfterProperties["Title"] = "test";
            base.ItemAdding(properties);
}

What's wrong here? I really don't know what to do. Thanks!!!
Regards
Chris


Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>