I created following listView through Visual Studio in my List on SharePoint-Hosted Add-in project:

enter image description here

Where i created listView - Generated xml like this:

<View BaseViewID="2"
 DisplayName="My holidays"

I insert This query for current view where show my holidays:

   <OrderBy><FieldRef Name="ID"></FieldRef></OrderBy>
         <FieldRef Name="Author" />
         <Value Type="User">[Me]</Value>

How to render this view in my .asp page?

This is my code in default.aspx page, where i need to show My holidays view:

<asp:Content ContentPlaceHolderID="PlaceHolderMain" runat="server">
<WebPartPages:WebPartZone runat="server"
    FrameType="TitleBarOnly" ID="full" Title="loc:full">
    <WebPartPages:XsltListViewWebPart ID="XsltListViewWebPart2"
        runat="server" ListUrl="Lists/Holidays" IsIncluded="True"
        NoDefaultStyle="TRUE" Title="Images used in switcher"
        PageType="PAGE_NORMALVIEW" Default="False"
        ViewContentTypeId="0x" ViewId="2">

1) Is it true my query?

2) I dont know ViewID="2" is correct to render "My holidays" view.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.