我在sharepoint网站的母版页上使用ASPxNavBar(Sharepoint Foundation 2010)。我成功地集成了控件,以便它正常运行但是我有一个问题,导航栏的状态(哪些组是打开的)没有被持久化。这是一些代码
<Sharepoint:SPNavigationManager
id="QuickLaunchNavigationManager"
runat="server"
QuickLaunchControlId="ASPxNavBar1"
ContainedControl="QuickLaunch"
EnableViewState="false">
<dx:ASPxNavBar ID="ASPxNavBar1"
AutoCollapse="true"
Paddings-PaddingLeft="0"
Paddings-PaddingRight="0"
Paddings-PaddingTop="0"
runat="server"
GroupSpacing="0"
AllowSelectItem="true"
BackColor="Transparent"
ForeColor="White"
Width="220px"
ItemLinkMode="TextOnly"
EnableAnimation="true"
ShowExpandButtons="true"
AllowExpanding="true"
ItemStyle-SelectedStyle-Font-Italic="true"
ItemStyle-SelectedStyle-Font-Bold="true"
ExpandImage-Url="/_layouts/images/FamilyCarePRL/Buttons/Expand.png"
CollapseImage-Url="/_layouts/images/FamilyCarePRL/Buttons/Contract.png"
SaveStateToCookies="True"
>
<GroupHeaderStyle Height="40" BackColor="Transparent">
<BackgroundImage ImageUrl="/_layouts/images/FamilyCarePRL/Buttons/NavBarButtonGradient.png"
Repeat="RepeatX" />
<Border BorderColor="Black"></Border>
</GroupHeaderStyle>
<Groups>
<dx:NavBarGroup Name="AboutUs" Text="About Us">
<Items>
<dx:NavBarItem Name="Vision" Text="Our Vision">
<Template>
<asp:ImageButton ID="ImageButton1" ImageUrl="/_layouts/images/FamilyCarePRL/Buttons/Vision.png"
PostBackUrl="<% $SPUrl:~SiteCollection/SitePages/Vision.aspx%>" runat="server" />
</Template>
</dx:NavBarItem>
.
.
问题是,当我点击图像按钮时,它会将您带到网站页面,但NavBar的状态不会保留。我已将SaveStateToCookies设置为true,但这似乎不起作用。任何建议都非常感谢
答案 0 :(得分:1)
ASPxNavBar根据NavigateUrl和页面Url同步所选的NavBarItem。要解决此问题,请按如下所示指定NavBarItem的NavigateUrl:
<dx:NavBarItem ... NavigateUrl="<% $SPUrl:~SiteCollection/SitePages/Vision.aspx%>">
</dx:NavBarItem>