More in this section

Forums / Developing with Sitefinity / Get itemID in SaveContent

Get itemID in SaveContent

2 posts, 0 answered
  1. Christian
    Christian avatar
    20 posts
    12 Mar 2008
    16 Sep 2009
    Link to this post

    we want to override SaveContent in our View Logic of a generic content based module (new view).

    We need the current or better new itemID of the new item to transfer it to another system.

    Whats the correct way to get the itemid after or better while creating a new item?

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    16 Sep 2009
    Link to this post
    Hello Christian,

    In your view you can override GetPreviewCommand(Guid itemId) where you have direct access to the Content item Id as a parameter of the method above. The method is called after SaveContent();

    Another option is getting the Id from the QueryString once the item is created

    ModuleItemPreview itemPreview = (ModuleItemPreview)this.Parent.Parent;                 
    Guid contentID = new Guid(CmsHttpRequest.Current.QueryStirng[itemPreview.ParameterKey]);  

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered