none
Дублируется веб часть при обновление app RRS feed

  • Вопрос

  • Есть SharePoint hosted app в нем есть список и он выводится через вебчасть на странице

                   <div>
    
                        
                        <WebPartPages:WebPartZone runat="server" FrameType="None" ID="WebPartZone" >
                            <WebPartPages:XsltListViewWebPart
                                runat="server"
                                ListUrl="Lists/IdeasList">
                            </WebPartPages:XsltListViewWebPart>
                        </WebPartPages:WebPartZone>
    
                    </div>

    Все работает хорошо но есть одна проблема, при обновление приложения страница на которой размещена веб часть заменяется нормально (html код), но вебчасть дублируется (на страницу добавляется еще одна копия вебчасти ниже).

    Как добавить вебчасть на страницу чтобы она не дублировалась при обновление?



    30 июня 2013 г. 16:27

Ответы

  • Добрый день,

    С такой проблемой столкнулись англоговорящие пользователи мсдн'a и нашли решение.

    А вот и цитата со страницы мсдна

    In one scenario, you may want to replace a file in an existing component with a new file that has a different name or path, instead of changing the file. Suppose that the earlier version of the Feature contained a customizable page type, such as a Web Parts page, and suppose that a user added a Web Part to the page. All later requests for that page from that user are redirected to the customized version of the page in the content database, not the uncustomized page on the file system. If you change the file as part of an update, the user who customized the old page still sees the customized version of the old page, not the new page. To prevent this, you must replace the old file with a new one. To do this, add a MapFile element to the VersionRange section. Set the FromPath attribute to the path of the file that is being replaced, and set the ToPath attribute to the path of the replacement file. The replacement file must differ in either name or path. The effect of the MapFile element is to redirect requests for the old file to the replacement file before the underlying redirection to the content database can occur. All users see the replacement file, and users have to redo their customizations. (The replacement file should also be treated as a new file as described in the procedure To update the app web Feature the first time earlier in this article.)


    View Oleg Nesterov's profile on LinkedIn
    SharePoint Advanced Visibility Options project
    SharePoint Managed Metadata Claims Provider project

    2 июля 2013 г. 22:40