【发布时间】:2011-10-23 07:28:06
【问题描述】:
我正在处理一个自定义 Web 部件,它有一个 XSL 链接属性,可将其连接到运行该 Web 部件的 XSLT 文件。我想创建另一个布尔字段,选中该字段后,Web 部件将链接到另一个 XSLT 文件。我不能使用 get/set 方法,因为这不是标准的 Web 部件。我没有驱动此 Web 部件的 C# 页面。我确实有包含所有属性值的 .webpart 文件,我认为这是我需要放置代码的地方。我只是不确定如何做到这一点。任何帮助将非常感激。这是 .webpart 文件的一部分:
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="Microsoft.SharePoint.WebPartPages.DataFormWebPart, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="PageSize" type="int">-1</property>
<property name="HelpMode" type="helpmode">Modeless</property>
<property name="Height" type="string" />
<property name="SampleData" type="string" null="true" />
<property name="AllowConnect" type="bool">True</property>
<property name="CatalogIconImageUrl" type="string" />
<property name="XslLink" type="string">/home/appbar.xslt</property>
<property name="AllowClose" type="bool">True</property>
<property name="Hidden" type="bool">False</property>
<property name="MissingAssembly" type="string">Cannot import this Web Part.</property>
<property name="TitleIconImageUrl" type="string" />
<property name="ChromeState" type="chromestate">Normal</property>
<property name="FireInitialRow" type="bool">True</property>
<property name="Description" type="string" />
<property name="AllowMinimize" type="bool">True</property>
<property name="Xsl" type="string" null="true" />
<property name="ExportMode" type="exportmode">All</property>
<property name="AllowZoneChange" type="bool">True</property>
<property name="Default" type="string" />
<property name="UseSQLDataSourcePaging" type="bool">True</property>
<property name="ParameterBindings" type="string">
<ParameterBinding Name="ListName" Location="None" DefaultValue="MDocLinks"/>
<ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
<ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
<ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
</property>
<property name="DisplayName" type="string" />
<property name="NoDefaultStyle" type="string">TRUE</property>
<property name="Title" type="string">MDock</property>
<property name="AllowHide" type="bool">True</property>
<property name="ViewFlag" type="string">0</property>
</properties>
</data>
</webPart>
</webParts>
这是其中的大部分。我不想填写太多页面。 :)
【问题讨论】:
标签: visual-studio sharepoint web-parts